1.0.0-rc.3 • Published 2 years ago

json-table-format v1.0.0-rc.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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

References