JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 720
  • Score
    100M100P100Q101156F
  • License MIT

Generate markdown tables from JSON data at the command line.

Package Exports

  • tablemark-cli

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tablemark-cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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