npm.io
2.0.4 • Published 6 years agoCLI

json_prettify

Licence
MIT
Version
2.0.4
Deps
2
Size
31 kB
Vulns
0
Weekly
0
Stars
1

json_prettify

npm version Gitlab pipeline status (branch) codecov License node Greenkeeper badge

Takes javascript objects in any notation and converts them to proper JSON with indendation.

For example:

$ echo "{foo: 'bar',n:3}" | json_prettify

Output:

{
    "foo": "bar",
    "n": 3
}

Installation

$ npm install -g json_prettify

Usage

$ json_prettify file.json <options>

or

$ cat file.json | json_prettify <options>
Options
  • -o output.json or --out file.json write output to file
  • -s <number> or --spaces <number> number of spaces for indentation
  • --help help text

Keywords