A CLI tool for XDU work on How to use asynchronous programming techniques.
Clone the repository:
Install the dependencies:
npm i
Install the package globally on your machine: (If you don't, you won't be able to use it on the command line)
npm i -g
- Send a GET request to a URL to get the web page content:
httprequest get
For example:
httprequest get http://39.101.74.9:8090
httprequest get https://github.com
- Display previously visited urls:
httprequest list
Connections that have been successfully accessed and timed out are displayed.
- Data storage location:
I use the open source conf package for data saving.
You can modify the storage address in commands/httprequest.js
. Please see the code comments for details.
- Access timeout setting:
Also in the commands/httprequest.js file, just modify the timeoutThreshold
variable.
- npm i -g will add some content to your node .js, and you can remove them to avoid affecting your command line.
Since I use NVM for node .js management, you can find your node .js path yourself under this path
These projects have helped me a lot:
- shahednasser/todos-cli --- Shahednasser/All-CLI (github.com)
- https://github.com/sindresorhus/conf
- https://github.com/tj/commander.js
Welcome to my blog:http://39.101.74.9:8090 builde by Halo.