sli*_*wp2 44
node.js 版本v10.16.0
,你可以使用console.table API,而无需安装任何节点模块。
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);
Run Code Online (Sandbox Code Playgroud)
终端中的标准输出是这样的:
小智 5
var values = [];
Array.forEach(function(b, i) {
values.push(
{
'Symbol': b.a,
'BID': b.b,
'CONVERT1': b.c,
'Buy': b.d,
'Sell': b.e,
'Convert2': b.f
});
});
console.table(values);
Run Code Online (Sandbox Code Playgroud)
结果控制台