Skip to content

harttle/invert-markdown-table

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Online inverter here: http://harttle.land/invert-markdown-table/, also available on npm:

npm i invert-markdown-table

Usage

var invertMarkdownTable = require('invert-markdown-table');
var source = 'a | b\n---|---\nc | d'
var result = invertMarkdownTable(source);
console.log(result);
// Outputs:
// a | c\n---|---\nb | d

Use in Browser

Global Variable:

var source = 'a | b\n---|---\nc | d';
var result = window.invertMarkdownTable(source);

RequireJS:

require(['invert-markdown-table'], function (invertMarkdownTable) {
    var source = 'a | b\n---|---\nc | d'
    var result = invertMarkdownTable(source);
});