0.1.4 • Published 8 years ago

table-style v0.1.4

Weekly downloads
2
License
Apache-2.0
Repository
github
Last release
8 years ago

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

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago