Registry / devops / list-it

list-it

JSON →
library1.3.13jsnpmunverified

list-it is a fixed-column text table formatter for JavaScript/Node.js, version 1.3.13. It offers a simple API (ListIt class) to build aligned text tables with options like auto-alignment of decimals, column width truncation, header rows with underline, and a CLI command (listit) to format JSON arrays as tables. Compared to other table libraries (e.g., cli-table, easy-table), list-it focuses on fixed-width columns and automatic decimal alignment, but it does not support borders, padding, or complex styling. The package is stable with infrequent releases, last updated in 2021.

npm install list-it
INSTALL
IMPORT
SIG · LIST-IT
L
list-it
devopsjavascriptv1.3.13
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ListIt
const ListIt = require('list-it');
import ListIt from 'list-it';
list-it is CommonJS only; no ESM or TypeScript types are provided.

Creates a simple two-column table using the ListIt chaining API and prints it.

const ListIt = require('list-it'); const buf = new ListIt(); buf.d('1').d('Apple').nl(); buf.d('2').d('Banana').nl(); console.log(buf.toString()); // Output: // 1 Apple // 2 Banana
Debug
Known issues
gotchaColumn width truncation affects all subsequent cells in that column until reset. If you set a width for column index 1, it will apply to all rows, potentially cutting off long text unexpectedly.
fix
Ensure column widths are set before adding data, or reset them with an explicit width of 0 to disable truncation.
affects: >=1.0.0
gotchaThe 'autoAlign' option only aligns numeric data if the column consists entirely of numbers. If any cell in the column is non-numeric, alignment is skipped for that column.
fix
Use autoAlign only when columns are strictly numeric. For mixed content, consider manual padding.
affects: >=1.0.0
deprecatedThe CLI command is bundled, but its option parsing uses an older version of commander that may not accept modern syntax like --version.
fix
Use 'listit --help' for usage; or install list-it globally and run 'listit' without arguments.
affects: >=1.2.0 <1.4.0
Errors
Common errors & fixes
TypeError: list_it.default is not a function
ESM import style used on a CommonJS module: 'import ListIt from 'list-it''.
fix
Use require('list-it') instead.
Cannot find module 'list-it'
Package not installed or installed in a parent directory where Node cannot resolve it.
fix
Run 'npm install list-it' in the project root.
Upgrade
Version history
1.3.13latest on npm
Audit
Dependencies
commanderrequiredCLI command parsing for the listit binary
Agent activity
2 hits · last 30 days
node
2
Resources
list-it — npm install list-it · libregistry