Tabletomd attempts to convert local or remote HTML tables into Markdown Table with a very low footprint.
Install via npm
npm install tabletomd --save
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 |
import { convertUrl } from 'tabletomd';
const markdown = await convertUrl('https://www.npmjs.com/package/rc-table');
The following node libraries make this utility super easy:
This project is created using generator-stupid.