Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mplewis/csvtomd-lib
Generate Markdown tables from CSV data.
https://github.com/mplewis/csvtomd-lib
Last synced: about 2 months ago
JSON representation
Generate Markdown tables from CSV data.
- Host: GitHub
- URL: https://github.com/mplewis/csvtomd-lib
- Owner: mplewis
- License: mit
- Created: 2018-07-16T00:42:38.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T20:59:44.000Z (about 2 years ago)
- Last Synced: 2024-04-13T04:56:07.246Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 393 KB
- Stars: 9
- Watchers: 3
- Forks: 1
- Open Issues: 28
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# csvtomd-lib
Generate Markdown tables from CSV data.
# Usage
```js
import csvToMd from 'csvtomd-lib'const csvString = `
Name,Position,Wanted
"Andromedus, Darrow au",Leader,Yes
"Augustus, Victoria au",Accomplice,Yes
`.trim()const csvTable = [
['Name', 'Position', 'Wanted'],
['Andromedus, Darrow au', 'Leader', 'Yes'],
['Augustus, Victoria au', 'Accomplice', 'Yes']
]// Both of these return the same Markdown table string
csvToMd.fromString(csvString)
csvToMd.fromTable(csvTable)
```# Example Output
```
| Name | Position | Wanted |
| --------------------- | ---------- | ------ |
| Andromedus, Darrow au | Leader | Yes |
| Augustus, Victoria au | Accomplice | Yes |
```renders as:
| Name | Position | Wanted |
| --------------------- | ---------- | ------ |
| Andromedus, Darrow au | Leader | Yes |
| Augustus, Victoria au | Accomplice | Yes |# License
MIT