1.1.3 • Published 3 years ago

@openinf/util-md-table v1.1.3

Weekly downloads
78
License
MIT
Repository
github
Last release
3 years ago

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-table

Usage

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

ParamTypeDescription
mdTblstringA markdown table as a string.
cellTransformfunction | undefinedA function run on contents of each cell.
attribCellTransformfunction | undefinedA transform only for attribute cells.

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago

1.0.0-alpha.3

3 years ago

1.0.0-alpha.2

3 years ago

1.0.0-alpha

3 years ago