UNPKG

node-esp

Version:

Command line interface for the NodeMCU ESP8266 module. Manage the filesytem, monitor, flash firmware and more.

31 lines (21 loc) 590 B
'use strict'; var Table = require('cli-table2'); module.exports = function(fields, colWidths){ var headers = Object.keys(fields); colWidths = colWidths || [40, 20] return function(data){ var table = new Table({ head: headers, colWidths: colWidths }); var out; data.map(function(file){ out = []; Object.keys(fields).map(function(field){ out.push(file[fields[field]]); }); table.push(out); }); console.log(table.toString()); }; };