cli-tableau is a robust JavaScript library designed for rendering pretty, highly customizable tables in command-line interfaces using Unicode characters. It offers extensive control over table structure, including options for horizontal, vertical, and cross-table layouts, and allows for detailed customization of borders, column widths, and styling characters. The current stable version, 2.0.1, indicates a mature codebase. Its release cadence appears to be relatively slow, focusing on stability. A key differentiator is its granular control over the `chars` property, enabling developers to define every single line and intersection character, from full Unicode borders to completely invisible separators, offering unparalleled flexibility in visual output compared to simpler table rendering utilities. It is primarily used within Node.js environments for CLI tools.
npm install cli-tableauVerified import paths — ran on the pinned version, not inferred.
Demonstrates creating a basic horizontal table with custom headers, column widths, and basic styling, then populating it with data rows for console output.
For ESM projects, you might need `import { createRequire } from 'module'; const require = createRequire(import.meta.url); const Table = require('cli-tableau');` or configure your bundler to handle CJS modules.Always test your custom `chars` configuration with various data inputs. Refer to the documentation examples for common patterns, such as removing horizontal lines between rows by clearing `mid`, `left-mid`, `mid-mid`, `right-mid`.
Ensure you are using the CommonJS `const Table = require('cli-tableau');` pattern, as the library exports its main constructor as the default CommonJS export.Verify that `require('cli-tableau')` successfully returned the Table constructor and that `new Table()` was called correctly. Check for typos in the import path or symbol, and ensure the module loaded as expected.No dependency data recorded yet.