Project

ppjson

0.01
No commit activity in last 3 years
No release in over 3 years
Pretty print JSON strings by piping or passing them as arguments, without reordering your keys
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0

Runtime

 Project Readme

Ppjson

Pretty print your JSON on the command-line the easy way.

Installation

Add this line to your application's Gemfile:

gem 'ppjson'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ppjson

Usage

Pretty printing your JSON on the command line has never been easier:

ppjson '{"a":"b"}'

If another command returns some JSON for you:

curl http://mydomain.com/blah.json | ppjson

Do you have some JSON in a file? See a pretty printed version of it:

ppjson -f my_file.json

Or maybe you want to pretty print the contents of the file and then update the file with the pretty printed version:

ppjson -f -i my_file.json

Perhaps you already have some pretty printed JSON in a file, but you want to pass it as an argument to some other command, so you need to un-pretty print it:

ppjson -f -u my_file.json

You can even store your un-pretty printed version back into the file for later:

ppjson -f -u -i my_file.json

Get some help with:

ppjson -h

It's easier to remember than python -mjson.tool and it won't annoyingly reorder your keys for you.

If you're using RVM just dump it into your global gemset to have it available everywhere.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request