Package detail

table-printer-cli

console table printer cli. Print table on bash terminal

console-table, console-log, print-table, cli

readme

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 simple example first:

ctp -i '[{"name":"Alice","score":95},{"name":"Bob","score":82}]'

Basic Example

You can also pipe JSON data from other commands:

# Pipe data from another command
echo '[{"name":"Alice","role":"Developer"},{"name":"Bob","role":"Designer"}]' | ctp -s

Pipe Example

Using Table Options

Customize your tables with colors, styles, and more using the --tableOptions parameter. These options are compatible with console-table-printer library.

# Colorize specific columns
ctp -i '[
  {"name": "John", "status": "active", "score": 95},
  {"name": "Jane", "status": "inactive", "score": 82},
  {"name": "Bob", "status": "active", "score": 78}
]' --tableOptions '{
  "title": "Employee Status",
  "columns": [
    {"name": "status", "color": "green", "alignment": "right"},
    {"name": "score", "color": "yellow"}
  ]
}'

Complex Example

Detailed Usage

Usage: ctp [options]

Options:
  -v, --version              output the current version
  -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

changelog

1.3.1 (2025-06-11)

Bug Fixes

1.3.0 (2025-06-11)

Features

1.2.5 (2025-06-11)

Bug Fixes

1.2.4 (2025-06-01)

Bug Fixes

1.2.3 (2025-05-31)

Bug Fixes

1.2.2 (2025-05-31)

Bug Fixes

  • Remove program.inp from console log output (#352) (0a3ffeb)

1.2.1 (2025-05-30)

Bug Fixes

1.2.0 (2025-05-30)

Features

1.1.7 (2025-05-30)

Bug Fixes

1.1.6 (2020-12-06)

Bug Fixes

  • deps: update dependency console-table-printer to ^2.7.3 (a16ef72)

1.1.5 (2020-12-06)

Bug Fixes

  • deps: update dependency console-table-printer to ^2.7.2 (7e9a11c)

1.1.4 (2020-12-05)

Bug Fixes

  • deps: update dependency console-table-printer to ^2.7.1 (cbf8f77)

1.1.3 (2020-12-04)

Bug Fixes

  • deps: update dependency console-table-printer to ^2.6.0 (5757819)

1.1.2 (2020-11-21)

Bug Fixes

  • console.error for input error message (#221) (18af899)

1.1.1 (2020-11-19)

Bug Fixes

  • deps: update dependency console-table-printer to ^2.5.1 (5282715)

1.1.0 (2020-11-04)

Bug Fixes

  • fixing npm token with publish right (bd9b88f)

Features