1.1.3 • Published 5 years ago
@openinf/util-md-table v1.1.3
The high-level goal of @openinf/util-md-table is to serve as a Node.js
package containing utilities for common operations on Markdown tables
allowing users to make use of them in new ways. As is the case with any
software project in continuous development, omissions and errors may exist, for
which contributions are welcome.
Installation
@openinf/util-md-table runs on Node.js and is available via npm.
npm install @openinf/util-md-tableUsage
import { mdTable2json } from '@openinf/util-md-table';
const sampleTable = [
'| Col1 | Col2 | Col3 | Col4 |',
'|:-----:|:-----:|:-----:|:-----:|',
'| one | two | three | four |',
'| Fee | Fie | Foe | Fum |',
].join('\n');
const sampleTableObject = mdTbl2json(sampleTable, (v) => v.toLowerCase());
console.log(sampleTableObject);[
{ col1: 'one', col2: 'two', col3: 'three', col4: 'four' },
{ col1: 'fee', col2: 'fie', col3: 'foe', col4: 'fum' }
]mdTbl2json(mdTbl, cellTransform, attribCellTransform) ⇒ Array.<Object>
Kind: global function
| Param | Type | Description |
|---|---|---|
| mdTbl | string | A markdown table as a string. |
| cellTransform | function | undefined | A function run on contents of each cell. |
| attribCellTransform | function | undefined | A transform only for attribute cells. |
1.1.3
5 years ago
1.1.2
5 years ago
1.1.1
5 years ago
1.1.0
5 years ago
1.0.0
5 years ago
1.0.0-alpha.3
5 years ago
1.0.0-alpha.2
5 years ago
1.0.0-alpha
5 years ago