Socket
Book a DemoInstallSign in
Socket

table-printer-cli

Package Overview
Dependencies
Maintainers
1
Versions
255
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

table-printer-cli

console table printer cli. Print table on bash terminal

1.2.0
Source
npmnpm
Version published
Maintainers
1
Created
Source

table-printer-cli

📟🍭Printing Pretty Tables on your terminal

codecov npm version install size semantic-release

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:

Screenshot

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:

# Color the entire table red
ctp -i '[{"id":1,"name":"John"},{"id":2,"name":"Jane"}]' --tableOptions '{"style": {"headerColor": "red", "color": "red"}}'

# Use custom column styles
ctp -i '[{"id":1,"status":"active"},{"id":2,"status":"inactive"}]' --tableOptions '{"columns": [{"name": "status", "color": "green"}]}'

# Change table title
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

Keywords

console-table

FAQs

Package last updated on 30 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.