A Node.JS replacement for curl
$ npm install -g carl-cli
You can just use the URL as an argument to carl:
$ carl pokeapi.co/api/v2/pokemon/1
The previous command will show the following result:
> carl pokeapi.co/api/v2/pokemon/1
Response Status Code: 200
Content-Type: json
Content-Encoding: gzip
Showing a structured version of the body response:
{ abilities:
[ { ability: [Object], is_hidden: true, slot: 3 },
{ ability: [Object], is_hidden: false, slot: 1 } ],
base_experience: 64,
It even works with HTML pages:
> carl github.com
Response Status Code: 200
Content-Type: html
Content-Encoding: gzip
Showing a structured version of the body response:
{ title: 'The world’s leading software development platform · GitHub',
description: 'GitHub is where people build software. More than 31 million people use GitHub to discover, fork, and contribute to over 100 million projects.',
language: 'en',
author: undefined,
publisher: 'GitHub',
url: 'https://github.com' }
Or, alternatively, use the command prompt:
$ carl
> carl
? Write or paste the url you want to use https://news.ycombinator.com/
Response Status Code: 200
Content-Type: html
Content-Encoding: gzip
Showing a structured version of the body response:
{ title: 'Hacker News',
description: undefined,
language: false,
author: undefined,
publisher: undefined,
url: undefined }
- You can include the protocol in the url, or not. If you don't, carl will use HTTPS by default
- The currently supported Content-Types are
text/html
andapplication/json
. - For HTML pages, it returns structured data instead of the HTML code.
Feel free to open an issue or even opening a pull request.