ayonious/console-table-printer

[feature] reset, empty rows

Opened this issue · 6 comments

Hi, thanks for great job.
Is it possible to reset, empty rows ?
For making a dynamic array.

Could you set an example with image? @dawadam

Ok, but i don't have image.
Just if i take the basic exemple and i want to display and update content, like this :

const { printTable } = require('console-table-printer');

//Create a table
const testCases = [
  { index: 3, text: 'I would like some gelb bananen bitte', value: 100 },
  { index: 4, text: 'I hope batch update is working', value: 300 },
];

//print
printTable(testCases);

// waiting time (exemple fetch data on internet)
await delay(1000)

const testCases_v2 = [
  { index: 5, text: 'I would like update data !', value: 123 }
];

//print
printTable(testCases_v2);

Table can't be updated.

@dawadam for that reason you can create a Table instance like this and add as much content possible.
https://console-table.netlify.app/docs/doc-table-instance-creation

Ok, i see.
But if i want to update or remove data from the Table ?

True! that feature is not there.

The primary goal of this This package is printing objects.
Features related to changing/updating data is Optional
Having many features to manipulate data makes this package a Database/storage for which there are other packages.

But if this feature is requested by more people I will priotize it.

+1