jussi-kalliokoski / json2md

Convert JSON array of object to a markdown table

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

json2md

CI status

A CLI tool for formatting single-dimensional (nested arrays/objects not supported at the moment) JSON arrays of objects as markdown tables.

For example:

cat << EOF | json2md
[
    {
        "null": null,
        "bool": true,
        "number": "12345.6789",
        "big number": 12345678901234567891234,
        "string": "hello world"
    }
]
EOF

Outputs the following table:

| null   | bool | number     | big number              | string      |
|--------|------|------------|-------------------------|-------------|
| <null> | true | 12345.6789 | 12345678901234567891234 | hello world |

On macOS, if you want to swap the JSON stored in your clipboard with markdown, run the following:

pbpaste | json2md | pbcopy

About

Convert JSON array of object to a markdown table

License:ISC License


Languages

Language:Go 100.0%