table-printer-cli
📟🍭Printing Pretty Tables on your terminal

Synopsis
Printing Simple Table on your bash terminal. Its useful when you want to present some tables on console. There is a library that you can use similar way in nodejs/typescript Projects. console-table-printer
Installation
Using npm
npm install --global table-printer-cli
Using yarn
yarn global add table-printer-cli
Basic Example
Try this on your terminal.
ctp -i '[{ "id":3, "text":"like" }, {"id":4, "text":"tea"}]'
Output:

You can also pipe the input from stdin:
echo '[{ "id":3, "text":"like" }, {"id":4, "text":"tea"}]' | ctp -s
Using Table Options
You can customize the table output using the --tableOptions
parameter. This accepts the same options as the console-table-printer library.
Example with table options:
ctp -i '[{"id":1,"name":"John"},{"id":2,"name":"Jane"}]' --tableOptions '{"style": {"headerColor": "red", "color": "red"}}'
ctp -i '[{"id":1,"status":"active"},{"id":2,"status":"inactive"}]' --tableOptions '{"columns": [{"name": "status", "color": "green"}]}'
ctp -i '[{"id":1,"name":"John"}]' --tableOptions '{"title": "Users List"}'
Detailed usage
Usage: ctp [options]
Options:
-i, --input <value> input string
-s, --stdin read input from stdin
-t, --tableOptions <value> table options in JSON format
-h, --help display help for command
License
MIT