How to use the easy-table.Number function in easy-table

To help you get started, we’ve selected a few easy-table 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 bahmutov / next-update / src / print-modules-table.js View on Github external
verify.string(info.version, 'missing module version ' + info)

    t.cell('package', info.name)
    t.cell('current', info.from)
    t.cell('available', info.version)

    if (haveStats && info.stats) {
      var stats = info.stats
      verify.object(stats, 'expected stats object')

      var total = +stats.success + stats.failure
      var probability = total ? stats.success / total : null
      var probabilityStr = colorProbability(probability, options)
      t.cell('success %', probabilityStr, markProbability)
      t.cell('successful updates', info.stats.success, Table.Number(0))
      t.cell('failed updates', info.stats.failure, Table.Number(0))
    }
    t.newRow()
  })
  console.log(t.toString())