Is there a (Unix) shell script to format JSON in human-readable form?
Basically, I want it to transform the following:
{ "foo": "lorem", "bar": "ipsum" }
... into something like this:
{
"foo": "lorem",
"bar": "ipsum"
}
Is there a (Unix) shell script to format JSON in human-readable form?
Basically, I want it to transform the following:
{ "foo": "lorem", "bar": "ipsum" }
... into something like this:
{
"foo": "lorem",
"bar": "ipsum"
}
JSONLint has an open-source implementation on github can be used on the command line or included in a node.js project.
and then
or
Pygmentize
I combine Python's json.tool with pygmentize:
There are some alternatives to pygmentize which are listed in my this answer.
Here is a live demo:
The JSON Ruby Gem is bundled with a shell script to prettify JSON:
Script download: gist.github.com/3738968
I'm using httpie
And you can use it like this
brew install jq
command + | jq
curl localhost:5000/blocks | jq
)The PHP version, if you have PHP >= 5.4.