Skip to content

tcd/json-table-format

Repository files navigation

json-table-format

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

What does it do?

JSON goes in like this

{ 
    "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
    }
}

JSON comes out like this

{ 
    "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 }
}

References

About

Format JSON in rows & columns

Resources

License

Stars

Watchers

Forks

Packages

No packages published