Skip to content

nowk/table-ize.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

table-ize

Build Status Code Climate David DM

Turn markdown style(ish) table syntax to an array of objects.

Install

npm install table-ize

Example

tableize() turns a string like this:

| one | two | three |
| a   | b   | c     |
| d   | e   | f     |

To this:

[
  {one: "a", two: "b", three: "c"},
  {one: "d", two: "e", three: "f"}
]

Use tableize.rowsObject(), you can also create a single object by using the first column as the key and second column as the value.

| one   | a |
| two   | b |
| three | c |

Gives you:

{
  one: "a",
  two: "b",
  three: "c"
}

License

MIT

About

Turn markdown style(ish) table syntax to an array of objects.

Resources

Stars

Watchers

Forks

Packages

No packages published