Decode random strings: if you call the CLI with no arguments, you'll get a
prompt where you can past JSON strings and they'll be automatically displayed in a clearer way:
Command line options
It's possible to customize the output through some command line options:
# Change colors$ prettyjson --string=red --multiline_string=cyan --keys=blue --dash=yellow --number=green package.json# Do not use colors$ prettyjson --nocolor=1 package.json# Change indentation$ prettyjson --indent=4 package.json# Render arrays elements in a single line$ prettyjson --inline-arrays=1 package.json# Escape conflictive strings$ prettyjson --escape=1 package.json
Deprecation Notice: The old configuration through environment variables is
deprecated and it will be removed in the next major version (1.0.0).
Using it (from Node.js)
It's pretty easy to use it. You just have to include it in your script and call
the render() method: