joj

1.0.3 • Public • Published

Lightweight CLI http client.

joj lets you manage request collections with plain javascript files.

Usage

npm install -g joj

Create 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.js

And execute it:

./my_request_file.js

joj 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.

Readme

Keywords

Package Sidebar

Install

npm i joj

Weekly Downloads

2

Version

1.0.3

License

MIT

Unpacked Size

3.8 kB

Total Files

8

Last publish

Collaborators

  • jairovsky