tableize-string

v1.0.3
This is a tiny package that takes in an input and returns a simple string table.
table string tableize discord discord table markdown markdown table generator data and 4 more...

Tableize string

This is a tiny package that takes in an input and returns a simple string table.

Example:

import tableize from 'tableize-string';

const data = {
  headers: ['Title', 'Author', 'Date'],
  rows: [
    ['The Hobbit', 'J.R.R. Tolkien', '1937'],
    ['The Lord of the Rings', 'J.R.R. Tolkien', '1954-1955'],
    ['The Silmarillion', 'J.R.R. Tolkien', '1977'],
  ],
}

const table = tableize(data);

console.log(table);

Output:

╔═══════════════════════╦═══════════════════════╦═══════════════════════╗
║ Title                 ║ Author                ║ Date                  ║
╠═══════════════════════╬═══════════════════════╬═══════════════════════╣
║ The Hobbit            ║ J.R.R. Tolkien        ║ 1937                  ║
╠═══════════════════════╬═══════════════════════╬═══════════════════════╣
║ The Lord of the Rings ║ J.R.R. Tolkien        ║ 1954-1955             ║
╠═══════════════════════╬═══════════════════════╬═══════════════════════╣
║ The Silmarillion      ║ J.R.R. Tolkien        ║ 1977                  ║
╚═══════════════════════╩═══════════════════════╩═══════════════════════╝
npm i tableize-string

Metadata

  • MIT
  • Whatever
  • Brace Sproul
  • released 4/20/2023

Downloads

Maintainers