This article is introduction to json2mdtbl, a cli tool that converts an array of JSON objects into a Markdown table.

Installation

Download from https://github.com/tkuchiki/json2mdtbl/releases and place it in a location where your PATH environment variable can find it(e.g. /usr/local/bin).

Usage

It’s easy to use, just pipe in JSON or ndjson.

$ echo '[{"name": "alice", "age": 10},{"name":"bob", "age": 20}]' | json2mdtbl
| AGE | NAME  |
|-----|-------|
|  10 | alice |
|  20 | bob   |

$ echo -e '{"name": "alice", "age": 10}\n{"name":"bob", "age": 20}' | json2mdtbl
| AGE | NAME  |
|-----|-------|
|  10 | alice |
|  20 | bob   |

You can use it to get BigQuery results as JSON and put them into a Markdown table!