Skip to content

Markdown table generator with JSON support, perfect for creating tables for Yadda.

License

Notifications You must be signed in to change notification settings

macklevine/json-markdown-table

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSON Markdown Table

An node module that creates markdown tables containing formatted JSON data, perfect for Yadda test cases.

Installation

pending: npm install json-markdown-table

Usage

###.createJSONMarkdownTable(data) Data for a markdown table will look something like this:

[ 
  [ 
    { 
      "value" : "header1" 
    },
    { 
      "value" : "header2" 
    },
    { 
      "value": "header3" 
    } 
  ],
  [ 
    { 
      "value" : "value1" 
    },
    { 
      "value" : "value2" 
    },
    { 
      "value" : '{"mack":"levine","sara":"fraley"}'
    } 
  ] 
]

For the above object, .createJSONMarkdownTable() will return a string that looks like this:

|-------|-------|-------------------|
|header1|header2|header3            |
|-------|-------|-------------------|
|value1 |value2 |{                  |
|       |       |  "mack": "levine",|
|       |       |  "sara": "fraley" |
|       |       |}                  |
|-------|-------|-------------------|


.createJSONMarkdownTable() will accept JSON object cell values as both strings and objects.

Contributing

TBD

Improvements!

TODO: add the ability to accept Objects as cell values. Identify them, and stringify them.

Credits

Mack Levine

License

MIT

About

Markdown table generator with JSON support, perfect for creating tables for Yadda.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published