joj
v1.0.3
Published
Lightweight CLI http client. Manage your request collection with plain javascript files.
Readme
Lightweight CLI http client.
joj lets you manage request collections with plain javascript files.
Usage
npm install -g jojCreate a request file:
#!/usr/bin/env joj
url('https://jsonplaceholder.typicode.com/todos/3')
method('get')
header('accepts', 'application/json')Give it execution permissions:
chmod +x my_request_file.jsAnd execute it:
./my_request_file.jsjoj outputs the status code, headers, and body of the response as json. This is useful for piping the output to tools like jq.
Using environment variables
Define a file called blue.env.json in the same folder as your request files:
{
"MY_API": "https://example.com"
}Then, in your request files:
env('blue')
url(useenv('{{MY_API}}/veryimportant/todos'))By default, joj tries to load a file called default.env.json.
