https://github.com/ticklemycode/save-resp
Simple CLI tool for making ajax request then save the response to a local file system. Can be configured to run on an interval over a given amount of time. Depending on the content-type header the response will be saved as .json, .xml or .txt.
https://github.com/ticklemycode/save-resp
Last synced: 7 months ago
JSON representation
Simple CLI tool for making ajax request then save the response to a local file system. Can be configured to run on an interval over a given amount of time. Depending on the content-type header the response will be saved as .json, .xml or .txt.
- Host: GitHub
- URL: https://github.com/ticklemycode/save-resp
- Owner: ticklemycode
- Created: 2018-06-06T03:11:29.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-06T14:04:29.000Z (about 8 years ago)
- Last Synced: 2025-02-12T23:39:40.650Z (over 1 year ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# save-resp
Simple CLI tool for making ajax request then save the response to a local file system. Can be configured to run on an interval over a given amount of time. Depending on the content-type header the response will be saved as `.json`, `.xml` or `.txt`.
## Usage
The follow will make a request to a given url every second a period of 10 seconds while saving each response to the `/Users/me` directory.
```js
save-resp -u "" "data" -t 10000 -i 1000 -o "/Users/me/"
```
## Install
```js
npm install --save save-resp
```
## Options
| option | description |
|-----------------------|----------------------------------------------------------------------------------------------------------------------------------------|
| -h, --help | Display this usage guide. |
| -u, --url string | URL to make request to. |
| -o, --out string | Path to where you want to store responses. Default is current dir. |
| -i, --interval number | Interval at which URL will be called. |
| -t, --timeout number | Period of time you wish to make ajax calls. Interval is required. |
| -p, --prefix string | Prefix for filename. Ex: data_1528231421562.json |
| -s, --timestamp | Use timestamp or date in filename, Ex: data_1528231421562.json vs,data_Tue_Jun_05_2018_21:57:20_GMT-0400_(EDT).json. Default is false. |