ANSI COLOR TABLE
Tables for cli/stdout supporting colors using ansi npm module. Based on text-table but using ansi cursor, not color codes.
Examples
Table with colors and default options
var table = ; var data = "Username" "Email" "active" "john.smith" "john@gimail.com" "yes" "steve.balmes" "sbalmes@hotma.il" "yes" "james.durango" "james.durango@greenvine.com" "no" "elisa.polite" "epolite@" "yes" ; ;
Custom align, custom separator, centered header
var table = ; var data = "Username" "Email" "Age" "Active" "john.smith" "john@gimail.com" "9" "yes" "steve.balmes" "sbalmes@hotma.il" "19" "yes" "james.durango" "james.durango@greenvine.com" "99" "no" "elisa.polite" "epolite@" "109" "yes" ; ;
Redirect output to custom stream instead of process.stdout
var table = ;var Stream = ; var tableData = "Username" "Email" "active" "john.smith" "john@gimail.com" "yes" "steve.balmes" "sbalmes@hotma.il" "yes" ; var output_stream = ;var output_data = "";output_stream { output_data += data;};output_stream { // do something with data console;}; ;
Installation
With npm do:
$ npm install ansi-color-table
Testing
$ npm test
License
MIT