Install with:
$ (sudo) npm install -g csv2md
Small tool to convert (large) csv tables to markdown tables. Is able to process stdin
or csv files.
$ csv2md data.csv > data.md
You can also pipe (larger files):
$ cat data.csv | csv2md
| max_i | min_i | max_f | min_f |
|---|---|---|---|
| -122.1430195 | -122.1430195 | -122.415278 | 37.778643 |
| -122.1430195 | -122.1430195 | -122.40815 | 37.785034 |
| -122.4194155 | -122.4194155 | -122.4330827 | 37.7851673 |
…
$ cat data.csv | csv2md > data.md
The pretty
option will pad cells to uniform width, but will disable stream output.
$ csv2md --pretty data.csv > data.md
| max_i | min_i | max_f | min_f |
|--------------|--------------|--------------|------------|
| -122.1430195 | -122.1430195 | -122.415278 | 37.778643 |
| -122.1430195 | -122.1430195 | -122.40815 | 37.785034 |
| -122.4194155 | -122.4194155 | -122.4330827 | 37.7851673 |
…
Use -h
for more command options:
$ csv2md -h
Ensure that you have mocha installed npm install -g mocha
, then run:
$ npm run test
- file writing