Skip to content

Latest commit

 

History

History
54 lines (35 loc) · 757 Bytes

File metadata and controls

54 lines (35 loc) · 757 Bytes

pretty-json

This tiny program reads any JSON code from STDIN and output a well-formatted and colorized version.

Screenshots

Before:

before

After:

after

Installation

Tested only on OS X.

$ sudo curl -s https://raw.github.com/secreek/pretty-json/master/pj >/usr/local/bin/pj \
&& sudo chmod +x /usr/local/bin/pj

Usage

$ curl <url> | pj

or

$ cat <file.json> | pj

Try it now

An original JSON:

$ curl -s http://www.seismi.org/api/eqs?limit=20

Now with formatter and hilighter:

$ curl -s http://www.seismi.org/api/eqs?limit=20 | pj

An even complex sample:

$ curl -s https://api.github.com/events | pj