How to use the cliff.stringifyObjectRows function in cliff

To help you get started, we’ve selected a few cliff examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github flatiron / commandful / lib / commandful / controller.js View on Github external
resource.all(function(err, rows){
    if(err) {
      logger.error(JSON.stringify(err))
      return;
    }
    if (rows.length === 0) {
      logger.info('no ' + resource.lowerResource.magenta + ' found')
    } else {
      logger.info('showing all ' + resource.lowerResource.magenta);
      var lines = cliff.stringifyObjectRows(rows, Object.keys(resource.schema.properties), ['underline'], { columnSpacing: 5}).split('\n');
      lines.forEach(function(line){
        logger.info(line);
      })
    }
  })
};
github dfilatov / vow / benchmarks / comparison.js View on Github external
onComplete : function() {
            console.log(cliff.stringifyObjectRows(
                results,
                ['', 'mean time', 'ops/sec'],
                ['red', 'green', 'blue']) + '\n');
            results = [];
        }
    });
github dfilatov / vidom / benchmarks / index.js View on Github external
onComplete() {
                console.log('\n' + cliff.stringifyObjectRows(
                    results.sort((resultA, resultB) => resultA.mean - resultB.mean),
                    ['', 'mean time', 'ops/sec'],
                    ['', 'green', 'yellow']) + '\n');
            }
        }),
github dfilatov / jspath / benchmarks / comparison.js View on Github external
onComplete : function() {
                    console.log(cliff.stringifyObjectRows(
                        results,
                        ['', 'mean time', 'ops/sec'],
                        ['red', 'green', 'blue']) + '\n');
                    results = [];
                }
            }),
github bigcompany / big / node_modules / big-command / lib / command / controller.js View on Github external
resource.all(function(err, rows){
    if(err) {
      logger.error(JSON.stringify(err))
      return;
    }
    if (rows.length === 0) {
      logger.info('no ' + resource.name.magenta + ' found')
    } else {
      var lines = cliff.stringifyObjectRows(rows, Object.keys(resource.schema.properties), ['underline'], { columnSpacing: 5 }).split('\n');
      lines.forEach(function(line){
        logger.info(line);
      })
    }
  })
};
github fent / node-ytdl / bin / ytdl.js View on Github external
'bitrate',
      'audio bitrate'
    ];
    info.formats.forEach((format) => {
      format['quality'] = format.qualityLabel;
      format['bitrate'] = format.qualityLabel ?
        util.toHumanSize(format.bitrate) : null;
      format['audio bitrate'] = format.audioBitrate ?
        format.audioBitrate + 'KB' : null;
      cols.forEach((col) => {
        format[col] = format[col] || '';
      });
    });
    console.log(label('formats:'));
    const colors = ['green', 'blue', 'green', 'blue', 'green', 'blue'];
    console.log(cliff.stringifyObjectRows(info.formats, cols, colors));
  });

cliff

Your CLI formatting friend.

MIT
Latest version published 10 years ago

Package Health Score

56 / 100
Full package analysis