yyz945947732 / tabletomd

Tabletomd attempts to convert local or remote HTML tables into Markdown Table with a very low footprint

Home Page:https://www.npmjs.com/package/tabletomd

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tabletomd

Tabletomd attempts to convert local or remote HTML tables into Markdown Table with a very low footprint.

Version Coverage Status PRs Welcome GitHub license

Basic usage

Install via npm

npm install tabletomd --save

Local (convert)

import { convert } from 'tabletomd';
import fs from 'fs';
import path from 'path';
const content = fs.readFileSync(path.resolve(process.cwd(), './test/table.html'), {
  encoding: 'utf-8',
});
const markdown = convert(content);
console.log(markdown);
// |          Company           |     Contact     | Country |
// |:---------------------------|:----------------|:--------|
// |    Alfreds Futterkiste     |  Maria Anders   | Germany |
// | Centro comercial Moctezuma | Francisco Chang | Mexico  |

output

Remote (convertUrl)

import { convertUrl } from 'tabletomd';

const markdown = await convertUrl('https://www.npmjs.com/package/rc-table');

output

Credits

The following node libraries make this utility super easy:

LICENSE

MIT


This project is created using generator-stupid.

About

Tabletomd attempts to convert local or remote HTML tables into Markdown Table with a very low footprint

https://www.npmjs.com/package/tabletomd

License:MIT License


Languages

Language:TypeScript 64.0%Language:HTML 25.9%Language:JavaScript 10.1%