Miss any of our Open RFC calls?Watch the recordings here! »

table-style

0.1.4 • Public • Published

table-style

CLI Table formatter for NodeJS

Installing

For the latest stable version:

npm install table-style

Usage

import { Table } from "table-style";
 
interface User {
    name: string;
    role: string;
    office: string;
}
 
const table = new Table<User>({
    border: "single",
    groups: [
        { by: user => user.role }
    ],
    columns: [
        { header: "name", expression: x => x.name },
        { header: "office", expression: x => x.office, align: "right" }
    ],
    rowStyles: [
        { section: "header", border: { bottom: "double" }, foregroundColor: "white" },
        { section: "body", border: { top: "none", bottom: "none" } }
    ]
});
 
table.render(users, process.out);

API

Keywords

none

Install

npm i table-style

DownloadsWeekly Downloads

3

Version

0.1.4

License

Apache-2.0

Last publish

Collaborators

  • avatar