cli-table
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
colors | 1.0.3 | 87.07 kB | MIT | prod |
CLI-Table is a powerful utility tool for Node.js scripts that allows the creation and customization of tables to be viewed on the command line interface (CLI). Leveraging the power of Unicode, CLI-Table enables the production of visually appealing tables with features that include text truncation, alignment, color and background styling, column width customization, and more. Using CLI-Table, you can make data presentation in CLI much easier and more readable.
Using CLI-Table can be straightforward thanks to its easy-to-use API. First, you install the package using npm:
npm install cli-table
In your Node.js script, you require the package and use it like so:
var Table = require('cli-table');
var table = new Table({
head: ['Header 1', 'Header 2'],
colWidths: [100, 200]
});
table.push(
['Row 1 Column 1', 'Row 1 Column 2'],
['Row 2 Column 1', 'Row 2 Column 2']
);
console.log(table.toString());
CLI-Table allows for creating different types of tables like horizontal, vertical, and cross tables. You can also customize the table's styles by setting the 'chars' property to the desired shapes.
For detailed information on how to use all the features of CLI-Table, you can visit the official CLI-Table repository at https://github.com/Automattic/cli-table. From there, you can access comprehensive documentation on its API and usage examples, giving you a deeper understanding of how to fully leverage the utility for your requirements. Remember that the good practice of SEO is to refer and link back to the original source of the data.