How to use the gauge function from npmlog

Find comprehensive JavaScript npmlog.gauge code examples handpicked from public code repositorys.

41
42
43
44
45
46
47
48
49
50
51
function withCb (prom, cb) {
  prom.then((value) => cb(null, value), cb)
}


function token (args, cb) {
  log.gauge.show('token')
  if (args.length === 0) return withCb(list([]), cb)
  switch (args[0]) {
    case 'list':
    case 'ls':
fork icon0
star icon0
watch icon0

96
97
98
99
100
101
102
103
104
105
module.exports = function (prefix, cb) {
  validate('SF', [prefix, cb])
  <span class="missing-if-branch" title="if path not taken" >I</span>if (!prefix) <span class="cstat-no" title="statement not covered" >prefix = 'network'</span>
  if (!pulsers++) {
    pulse = setInterval(function () {
      log.gauge.pulse(prefix)
    }, 250)
  }
  return function () {
    if (!--pulsers) {
fork icon0
star icon0
watch icon2

187
188
189
190
191
192
193
194
195
196
let outData = []
let outDataLen = 0
child.stdout.on('data', (data) => {
  outData.push(data)
  outDataLen += data.length
  log.gauge.pulse('preparing git package')
})
child.stderr.on('data', (data) => {
  errData.push(data)
  errDataLen += data.length
fork icon0
star icon0
watch icon2

+ 3 other calls in file

47
48
49
50
51
52
53
54
55
56
  prom.then((value) => cb(null, value), cb)
}

function profileCmd (args, cb) {
  if (args.length === 0) return cb(new Error(profileCmd.usage))
  log.gauge.show('profile')
  switch (args[0]) {
    case 'enable-2fa':
    case 'enable-tfa':
    case 'enable2fa':
fork icon0
star icon0
watch icon2