Pretty prints JSON from stdin, files, or URLs
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
LICENSE
README.md
json-tidy.go

README.md

json-tidy GoDoc Go Report Card

Pretty prints JSON

Installation

First install Go.

If you just want to install the binary to your current directory and don't care about the source code, run

GOBIN=$(pwd) GOPATH=$(mktemp -d) go get github.com/carlmjohnson/json-tidy

Screenshots

$ json-tidy -h
Usage of json-tidy:

json-tidy [opts] [file|url|-]
        Gets input (defaults to stdin) and prints clean json to stdout.
  -html-safe
        Escape special characters for easy embedding in HTML
  -indent string
        Identation string (default "\t")
  -prefix string
        Prefix string
$ echo '{"a": 1, "b": [true, false]}' | json-tidy
{
        "a": 1,
        "b": [
                true,
                false
        ]
}