json-table-format
v1.0.0-rc.3
Published
Format JSON in a compact, readable, aligned way.
Downloads
3
Maintainers
Readme
json-table-format
Goals
given this input
{
"firstName": {
"type": "string",
"description": "The person's first name."
},
"lastName": {
"type": "string",
"description": "The person's last name."
},
"age": {
"description": "Age in years which must be equal to or greater than zero.",
"type": "integer",
"minimum": 0
}
}
produce this output
{
"firstName": { "type": "string", "description": "The person's first name." },
"lastName": { "type": "string", "description": "The person's last name." },
"age": { "type": "integer", "description": "Age in years which must be equal to or greater than zero.", "minimum": 0 }
}
Usage
First, install:
npm install -g json-table-format
Second, use:
# prints to STDOUT by default
json-table-format ./path/to/file.json
# or you can format the file in-place
json-table-format ./path/to/file.json --overwrite