Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/paulhammond/jp
An accurate, forgiving and fast JSON reformatter
https://github.com/paulhammond/jp
cli formatter json
Last synced: 3 days ago
JSON representation
An accurate, forgiving and fast JSON reformatter
- Host: GitHub
- URL: https://github.com/paulhammond/jp
- Owner: paulhammond
- License: mit
- Created: 2013-04-16T19:21:20.000Z (over 11 years ago)
- Default Branch: main
- Last Pushed: 2024-10-24T20:54:51.000Z (27 days ago)
- Last Synced: 2024-11-10T23:51:40.826Z (10 days ago)
- Topics: cli, formatter, json
- Language: Go
- Homepage: https://paulhammond.org/jp
- Size: 35.2 KB
- Stars: 61
- Watchers: 5
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jp
`jp` is a command line tool that reformats JSON to make it easier to read:
$ cat names.json
{"names":["Alice","Bob"]}
$ jp names.json
{
"names": [
"Alice",
"Bob"
]
}It only adds and removes whitespace, which means that your data won’t get
silently altered. For example, `"\u2603"` won’t get converted to `"☃"`, and
`1.1e1` won’t turn into `11`. The ordering remains the same, and invalid JSON
can be reformatted (within reason). This stuff shouldn’t matter, but people make
mistakes even with a well defined format like JSON, and accurate tools are
important when you’re trying to work out what’s gone wrong.For more information see the [project homepage][jp].
[jp]: https://paulhammond.org/jp
## Installing
Using [Homebrew](http://brew.sh/):
brew install paulhammond/tap/jp
If you don't use Homebrew you can download a [precompiled binary][releases] and
copy the `jp` file inside to somewhere in your path.[releases]: https://github.com/paulhammond/jp/releases
## Using
To prettify a JSON file:
jp data.json
To prettify from stdin, use - as the filename:
curl -sL https://phmmnd.me/names.json | jp -
To compact a JSON file:
jp --compact data.json
To get help:
jp --help