Toy JSON Parser & Formatter 🎨
cargo install --git https://github.com/enuesaa/jsonwith
$ 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
$ 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"
}
$ jsonwith json2yaml '{"a":"b"}'
a: b
Also, jsonwith reads stdin as json string.
$ cat data.json | jsonwith json2yaml
a: b