Is it possible without installing new package?
Here i am using cli-table package..
Any easy way to do it ?
The console. table() method displays tabular data as a table. This function takes one mandatory argument data , which must be an array or an object, and one additional optional parameter columns .
console.log([data][, ... Prints to stdout with newline. This function can take multiple arguments in a printf()-like way.
node.js version v10.16.0
, you can use console.table API without installing any node module.
const structDatas = [ { handler: 'http', endpoint: 'http://localhost:3000/path', method: 'ALL' }, { handler: 'event', endpoint: 'http://localhost:3000/event', method: 'POST' }, { handler: 'GCS', endpoint: 'http://localhost:3000/GCS', method: 'POST' } ]; console.table(structDatas);
The stdout in terminal like this:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With