Project

jsonpretty

0.04
Low commit activity in last 3 years
No release in over a year
Command-line JSON pretty-printer, using the json gem.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.17
~> 10.0
 Project Readme

jsonpretty

DESCRIPTION

Command-line JSON pretty-printer. Pipe any JSON output to pretty-print it with 2-space indent.

FEATURES

  • Parse and pretty-print JSON/JSONP either from stdin or from command-line arguments.
  • All arguments are concatenated together in a single string for pretty-printing.
  • Use @filename as an argument to include the contents of the file.
  • Use - or @- as an argument (or use no arguments) to read stdin.
  • Detects HTTP response/headers, prints them untouched, and skips to the body (for use with `curl -i').

SYNOPSIS

curl -i http://api.com/json | jsonpretty

REQUIREMENTS

  • For the Ruby version: any Ruby version >= 2 installed
  • For the Go version: none for the release binary, or Go 1.17 for go install

INSTALL

Install the Ruby version with rubygems:

gem install jsonpretty

Install the Ruby version globally with Homebrew and brew-gem:

brew install brew-gem
brew gem install jsonpretty

Install the Go version with go install (requires Go 1.17):

go install github.com/nicksieger/jsonpretty

Or install the Go version from a release with curl+tar:

VERSION=1.2.0
OS=$(uname -s)
ARCH=$(uname -m)
curl -L https://github.com/nicksieger/jsonpretty/releases/download/v${VERSION}/jsonpretty_${VERSION}_${OS}_${ARCH}.tar.gz | sudo tar -C /usr/local/bin -zxf - jsonpretty

LICENSE

See LICENSE.