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
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:
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: