2
GitHub - larswaechter/voici.js: A Node.js library for printing your data on the...
source link: https://github.com/larswaechter/voici.js
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
voici.js
A Node.js library for printing your data on the terminal
Introduction
voici.js (speak: /vwasi/) is an open source Node.js library written in TypeScript for beautifully displaying datasets in tabular form on the terminal including features like:
- Text / Column / Row styling
- Column sizing
- Accumulation
- Dynamic columns
- Data import from .json / .csv
- Table export to .png / .txt
- Sorting
Check out the website.
Installation
Install via npm:
npm i --save voici.js
Usage
import { Table } from 'voici.js';
const data = [
{ firstname: 'Homer', lastname: 'Simpson', age: 39 },
{ firstname: 'Marge', lastname: 'Simpson', age: 36 },
{ firstname: 'Bart', lastname: 'Simpson', age: 10 },
{ firstname: 'Lisa', lastname: 'Simpson', age: 8 },
{ firstname: 'Maggie', lastname: 'Simpson', age: 1 }
];
const table = new Table(data);
table.print();
The console output:
firstname lastname age
================================
Homer Simpson 39
Marge Simpson 36
Bart Simpson 10
Lisa Simpson 8
Maggie Simpson 1
You can find many more examples here.
Documentation
The following documentations are available:
Otherwise check out the tests for more examples.
Contributing
See CONTRIBUTING.md
License
voici.js is released under MIT license.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK