Simple table formatter wrapping table-cli
This module wraps the wonderful cli-table to allow you to pass in simle objects and arrays directly, and adds some shortcuts for foratting (e.g. border-style "none", "ascii", "fat" )
npm install format-table
var table = require("format-table");
console.log(table({ one: 1, two: 2 }));
// ┌─────┬───┐
// │ one │ 1 │
// ├─────┼───┤
// │ two │ 2 │
// └─────┴───┘
// using a single title
console.log(table("Helo World", { one: 1, two: 2 }));
// ┌─────────────┬───┐
// │ Hello World │ │
// ├─────────────┼───┤
// │ one │ 1 │
// ├─────────────┼───┤
// │ two │ 2 │
// └─────────────┴───┘
// with multiple titles
console.log(table(["key", "value"], { one: 1, two: 2 }));
//┌─────┬───────┐
//│ key │ value │
//├─────┼───────┤
//│ one │ 1 │
//├─────┼───────┤
//│ two │ 2 │
//└─────┴───────┘
// formatting options
console.log(table("No borders please", { one: 1, two: 2 }, "none"));
// No borders please
// one 1
// two 2