Numerous Packages Multiply
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

json2markdown

1.0.0 • Public • Published

json2markdown

Convert an array of JSON data to a markdown table in the GFM style.

Install

$ npm install --save json2markdown

Usage

var json2markdown = require('json2markdown');

var myJson = [
  {
    name: "Jason Bateman",
    occupation: "Actor",
    age: 45
  },
  {
    name: "Jason Derulo",
    occupation: "Singer-songwriter",
    age: 24
  },
  {
    name: "Jason Mraz",
    occupation: "Singer-songwriter",
    age: 37
  }
];

console.log(json2markdown(myJson));

/*
Outputs:

| name | occupation | age |
| ---- | ---------- | --- |
| Jason Bateman | Actor | 45 |
| Jason Derulo | Singer-songwriter | 24 |
| Jason Mraz | Singer-songwriter | 37 |

*/

install

npm i json2markdown

Downloadsweekly downloads

4

version

1.0.0

license

MIT

last publish

collaborators

  • avatar