For the complete documentation index, see llms.txt. This page is also available as Markdown.

⚡Quick Start

Getting started with voici.js

Install voici.js using your desired package manager:

npm i --save voici.js
yarn add voici.js

Provide a dataset and print it:

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 output:

Console Output

By default, the width of each column depends on the length of the values it contains. Instead of objects you can also provide arrays in your dataset.

Call .print(true) to clear the console before printing.

Last updated

Was this helpful?