Display datasets in a table using the Table class
mainTo display data in a tabular format in the terminal, import the Table class from voici.js, instantiate it with your dataset (an array of objects), and call the .print() method.
voici.js supports various features such as text/column/row styling, highlighting, filtering, dynamic columns, column sizing, accumulation, table export, and sorting.
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();