Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/harttle/invert-markdown-table
- Owner: harttle
- License: mit
- Created: 2018-05-17T12:05:42.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-02-20T16:00:26.000Z (10 months ago)
- Last Synced: 2024-10-14T20:43:19.235Z (2 months ago)
- Topics: gfm, invert, markdown, table, transpose
- Language: JavaScript
- Homepage: http://harttle.land/invert-markdown-table/
- Size: 6.84 KB
- Stars: 12
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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);
});
```