table-ize

0.0.1 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i table-ize

Weekly Downloads

1

Version

0.0.1

License

MIT

Last publish

Collaborators

  • yunghwakwon