prettyjson is package for formatting JSON data in a coloured YAML-style, perfect for CLI output.
1
|
npm install prettyjson |
CLI
1
2
3
4
5
|
$ prettyjson package .json ... $ curl https: //api.github.com/users/rafeca | prettyjson ... $ PRETTYJSON_KEYS=red PRETTYJSON_DASH=blue PRETTYJSON_STRING=yellow prettyjson package .json |
API
1
2
3
4
5
6
7
8
9
10
|
var prettyjson = require( 'prettyjson' ); var data = { username: 'rafeca' , projects: [ 'prettyprint' , 'connfu' ] }; console.log(prettyjson.render(data)); |
There are plenty of examples and information on thegithub page. Check it out!