JSPM

console-table-printer

1.0.0-beta6
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1331956
  • Score
    100M100P100Q192418F
  • License MIT

Printing pretty tables on console log

Package Exports

  • console-table-printer

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (console-table-printer) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Print Pretty tables on Your Console

Build Status npm version FOSSA Status dependencies Status devDependencies Status

Synopsis

Printing Simple Table with Coloring rows on your console. Its useful when you want to present some tables on console. Using as less code possible you can print the table on console.

Installation

npm install console-table-printer --save

Basic Example

const {Table} = require('console-table-printer');

//Create a table
const p = new Table();

//add rows with color
p.addRow({ index: 1, text: 'red wine please', value: 10.212 });
p.addRow({ index: 2, text: 'green gemuse please', value: 20.00 });
p.addRows([ //adding multiple rows are possible
    { index: 3, text: 'gelb bananen bitte', value: 100 },
    { index: 4, text: 'update is working', value: 300}
]);

//print
p.printAll();

Output:

Screenshot

You can also put some color to your table like this:

const p = new Table();
p.addRow({ index: 1, text: 'red wine', value: 10.212 }, {color: 'red'});
p.addRow({ index: 2, text: 'green gemuse', value: 20.00 }, {color: 'green'});
p.addRow({ index: 3, text: 'gelb bananen', value: 100 }, {color: 'yellow'});
p.printAll();

Output:

Screenshot

License

MIT