ayonious/console-table-printer

Table from object with config arguments for all columns

Opened this issue · 4 comments

Willing to take a crack at this myself, just let me know if this is wanted.

I think it would be useful for the Table constructor or a static from method accepts a object and automatically generates a table. Similar to console.table but also allows a config parameter to change column size and the like.

Let me know!

Could also be an addition to #printTable

Related, printTable should accept options.

Im thinking about how this will look like in code

printTable (rows, optional Options)

This will have same effect as what we have now

const t = new Table(optional Options);
t.addRows(rows);
r.printTable();

To me its already looking quite short the way a Table instance can be created with predefined options.

This could be useful feature for CLI tool