How to use the cli-table3.default function in cli-table3

To help you get started, we’ve selected a few cli-table3 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 uber / xviz / modules / cli / src / cmds / validate.js View on Github external
function printErrorSummary(stats, args) {
  // Form a table of the main errors one row per type
  const table = new Table({
    head: ['Type', 'Count', 'Invalid', 'Inv %', 'Unique Errors'],
    style: {head: ['white', 'bold']}
  });

  for (const message in stats.messages) {
    const count = stats.messages[message] || 0;
    const errors = stats.validationErrors[message] || 0;
    const errPer = (errors / count) * 100;

    const uniqueErrors = stats.uniqueErrors[message];
    const uniqueErrorCount = uniqueErrors ? Object.keys(uniqueErrors).length : 0;

    const row = [message, count, errors, errPer.toFixed(1), uniqueErrorCount];

    if (errors) {
      const coloredRow = [];

cli-table3

Pretty unicode tables for the command line. Based on the original cli-table.

MIT
Latest version published 7 months ago

Package Health Score

84 / 100
Full package analysis