pretty-table
A nice little npm package that can print table to the console
Installation
npm i @svkhrobbeck/pretty-table
oryarn add @svkhrobbeck/pretty-table
Usage
// Package supports esm and cjs modules
import PrettyTable from "@svkhrobbeck/pretty-table";
const table = new PrettyTable([
{
name: "Kurosaki Ichigo",
age: 17
},
{
name: "Sosuke Aizen",
age: 34
}
]);
table.print();
//Outputs the following to CLI:
╔═════════════════╦═════╗
║name ║ age ║
╠═════════════════╬═════╣
║Kurosaki Ichigo ║ 17 ║
║Sosuke Aizen ║ 34 ║
╚═════════════════╩═════╝