Skip to content

avantgardnerio/json-stringify-pretty-compact-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published