Skip to content

Latest commit

 

History

History
60 lines (52 loc) · 1.01 KB

README.md

File metadata and controls

60 lines (52 loc) · 1.01 KB

jsonwith

Toy JSON Parser & Formatter 🎨

ci

Install

cargo install --git https://github.com/enuesaa/jsonwith

Usage

$ jsonwith --help
Toy JSON Parser & Formatter

Usage: jsonwith [COMMAND]

Commands:
  format     Format JSON
  json2yaml  Convert JSON to YAML
  yaml2json  Convert YAML to JSON [Experimental]

Options:
  -v, --version  Print version
  -h, --help     Print help

Sub Commands

format

$ jsonwith format '{"a":"b"}'
{
  "a": "b"
}

Also, jsonwith reads stdin as json string.

$ cat data.json | jsonwith format
{
  "a": "b"
}

To specify tab size, pass --indent flag.

$ jsonwith format '{"a":"b"}' --indent 4
{
    "a": "b"
}

json2yaml

$ jsonwith json2yaml '{"a":"b"}'
a: b

Also, jsonwith reads stdin as json string.

$ cat data.json | jsonwith json2yaml
a: b