json-stringify-pretty-compact-cli

4.0.0 • Public • Published

json-stringify-pretty-compact-cli

A CLI wrapper around the json-stringify-pretty-compact-cli library.

Thanks and acknowledgements to Simon Lydell for creating this wonderful library.

Turns ugly JSON like:

{
  "bool": true,
  "short array": [
    1,
    2,
    3
  ],
  "long array": [
    {
      "x": 1,
      "y": 2
    },
    {
      "x": 2,
      "y": 1
    },
    {
      "x": 1,
      "y": 1
    },
    {
      "x": 2,
      "y": 2
    }
  ]
}

into:

{
  "bool": true,
  "short array": [1, 2, 3],
  "long array": [
    {"x": 1, "y": 2},
    {"x": 2, "y": 1},
    {"x": 1, "y": 1},
    {"x": 2, "y": 2}
  ]
}

Installation

npm install json-stringify-pretty-compact-cli

Usage

json-spc [--indent=<spaces>] [--max-length=<characters>] <file.json> [> newfile.json]

Options

  • indent: Defaults to 2. Works exactly like the third parameter of JSON.stringify.
  • max-length: Defaults to 80. Lines will be tried to be kept at maximum this many characters long.

License

MIT.

Package Sidebar

Install

npm i json-stringify-pretty-compact-cli

Weekly Downloads

13

Version

4.0.0

License

MIT

Unpacked Size

4.72 kB

Total Files

4

Last publish

Collaborators

  • bgard6977