Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tcd/json-table-format

Format JSON in rows & columns
https://github.com/tcd/json-table-format

Last synced: 5 days ago
JSON representation

Format JSON in rows & columns

Awesome Lists containing this project

README

        

# json-table-format

## Usage

First, install:

```bash
npm install -g json-table-format
```

Second, use:

```bash
# 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

```json
{
"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

```json
{
"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

- [JSON Lines](https://jsonlines.org/examples/)
- [rhysd/fixjson](https://github.com/rhysd/fixjson)