tablemark-cli
Generate markdown tables from JSON data at the command line.
Last updated 10 months ago by citycide .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install tablemark-cli 
SYNC missed versions from official npm registry.

tablemark-cli · Version License Travis CI JavaScript Standard Style

Generate markdown tables from JSON data at the command line.

Parse JSON input data into a markdown table from the command line, powered by the tablemark module.

features

This utility supports:

installation

yarn global add tablemark-cli

usage

Usage: tablemark <input-file> > <output-file> [options]

Commands:

  help  Display help

Options:

  -a, --align <list>    List of alignment types, applied in order to columns. (defaults to [])
  -c, --columns <list>  List of column names, defaults to object keys. (defaults to [])
  -h, --help            Output usage information
  -v, --version         Output the version number

To use the align and column options, you can use the -a or -c flags multiple times, like this:

tablemark input.json > output.md -a left -a center

... which will align the first two columns left and center respectively.

stdin

tablemark < input.json > output.md

ndjson

NDJSON is a form of JSON that delimits multiple JSON objects by newlines:

{"name":"trilogy","repo":"[citycide/trilogy](https://github.com/citycide/trilogy)","desc":"No-hassle SQLite with type-casting schema models and support for native & pure JS backends."}
{"name":"strat","repo":"[citycide/strat](https://github.com/citycide/strat)","desc":"Functional-ish JavaScript string formatting, with inspirations from Python."}
{"name":"tablemark-cli","repo":"[citycide/tablemark-cli](https://github.com/citycide/tablemark-cli)","desc":"Generate markdown tables from JSON data at the command line."}

This input from a file or stdin is supported just as if it were a JSON compatible array:

tablemark input.ndjson > output.md

see also

  • tablemark – the module used by this utility

contributing

Search the issues if you come across any trouble, open a new one if it hasn't been posted, or, if you're able, open a pull request. Contributions of any kind are welcome in this project.

The following people have already contributed their time and effort:

Thank you!

license

MIT © Bo Lingen / citycide

Current Tags

  • 2.0.0                                ...           latest (10 months ago)

4 Versions

  • 2.0.0                                ...           10 months ago
  • 1.1.0                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
  • 1.0.0-alpha.1                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 2
Dependencies (4)
Dev Dependencies (3)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |