{"id":18218,"library":"cli-table-redemption","title":"cli-table-redemption","description":"CLI Table Redemption is a fork maintained by Keymetrics to improve PM2's CLI table rendering. It generates beautiful unicode-aided tables for command-line Node.js scripts. Features customizable characters, chalk-based header styling, column width control, text truncation, alignment (left, right, center), and padding. Latest version 2.0.1 (2019-12-09) is mostly compatible with original cli-table but adds bug fixes and maintenance. It requires Node >= 0.12 and is commonly used with PM2 or other Node CLI tools. Few updates recently, but it's stable for terminal table output.","status":"maintenance","version":"1.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/Keymetrics/cli-table","tags":["javascript","cli","colors","table"],"install":[{"cmd":"npm install cli-table-redemption","lang":"bash","label":"npm"},{"cmd":"yarn add cli-table-redemption","lang":"bash","label":"yarn"},{"cmd":"pnpm add cli-table-redemption","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Used for color/background styling in table headers","package":"chalk","optional":false}],"imports":[{"note":"Package does not ship TypeScript definitions; uses CommonJS. Recommend using require() unless transpiling.","wrong":"import Table from 'cli-table-redemption'","symbol":"Table","correct":"var Table = require('cli-table-redemption')"},{"note":"Options object is required, not an array. Common mistake: passing head array directly.","wrong":"new Table(['A','B'])","symbol":"constructor","correct":"new Table({ head: ['A','B'], colWidths: [10,20] })"},{"note":"API uses Array-like push; no addRow method.","wrong":"table.addRow(['val1', 'val2'])","symbol":"Instance.push","correct":"table.push(['val1', 'val2'])"}],"quickstart":{"code":"var Table = require('cli-table-redemption');\nvar table = new Table({\n  head: ['Name', 'Age', 'City'],\n  colWidths: [20, 10, 20],\n  chars: {\n    'top': '═', 'top-mid': '╤', 'top-left': '╔', 'top-right': '╗',\n    'bottom': '═', 'bottom-mid': '╧', 'bottom-left': '╚', 'bottom-right': '╝',\n    'left': '║', 'left-mid': '╟', 'mid': '─', 'mid-mid': '┼',\n    'right': '║', 'right-mid': '╢', 'middle': '│'\n  },\n  style: { 'padding-left': 1, 'padding-right': 1 }\n});\ntable.push(\n  ['Alice', 30, 'New York'],\n  ['Bob', 25, 'San Francisco'],\n  ['Charlie', 35, 'Chicago']\n);\nconsole.log(table.toString());","lang":"javascript","description":"Creates a table with custom double-line border characters, header row, three columns, and three rows, then prints it."},"warnings":[{"fix":"Check package.json for dependency name: 'cli-table-redemption' not 'cli-table'.","message":"Package is a fork of the original cli-table and may have slight behavioral differences. Ensure you are using cli-table-redemption if your project depends on PM2's behavior.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use cli-table3 or cli-table2 for more active maintenance and TypeScript support.","message":"The original cli-table is unmaintained; cli-table-redemption is maintained by Keymetrics but also sees infrequent updates.","severity":"deprecated","affected_versions":"<2.0.0"},{"fix":"Always provide colWidths in the options object to avoid auto-sizing issues.","message":"Some users have reported that colWidths must be explicitly set; otherwise columns may be too narrow and text truncation occurs unexpectedly.","severity":"breaking","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run: npm install cli-table-redemption","cause":"Package not installed or wrong dependency name used.","error":"Cannot find module 'cli-table-redemption'"},{"fix":"Correct usage: var table = new Table(); table.push(['val']);","cause":"Using table incorrectly; table is an instance of Table, but common mistake is to call push on the class itself.","error":"TypeError: table.push is not a function"},{"fix":"Always provide head and colWidths if you intend to have headers, or omit head entirely for key-value tables.","cause":"When constructing table without head or colWidths, internal code may try to read head.length on undefined.","error":"Error: Cannot read properties of undefined (reading 'length')"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}