UNPKG

bambu-cli

Version:

Bambulabs CLI for printers

20 lines (17 loc) 597 B
const Table = require('easy-table'); const cfg = require('./config.js'); const logger = require('./logger.js'); module.exports = (args) => { const machines = cfg.get('machines'); logger.debug(JSON.stringify(machines, null, 4)); logger.log(`Showing information about ${machines.length} machine(s)\n`); const table = new Table(); machines.forEach((m) => { table.cell('ID', m.id); table.cell('Name', m.name); table.cell('IP Address', m.ip); table.cell('Access Code', m.token); table.newRow(); }); logger.log(table.toString()); };