Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/harttle/invert-markdown-table

Invert (transpose) a GFM Markdown Table
https://github.com/harttle/invert-markdown-table

gfm invert markdown table transpose

Last synced: about 2 months ago
JSON representation

Invert (transpose) a GFM Markdown Table

Awesome Lists containing this project

README

        

Online inverter here: , also available on [npm](https://www.npmjs.com/package/invert-markdown-table):

```bash
npm i invert-markdown-table
```

# Usage

```javascript
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:

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

RequireJS:

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