AlkantarClanX12

Your IP : 3.145.10.80


Current Path : /proc/self/root/opt/alt/alt-nodejs6/root/lib/node_modules/npm/lib/utils/
Upload File :
Current File : //proc/self/root/opt/alt/alt-nodejs6/root/lib/node_modules/npm/lib/utils/pulse-till-done.js

'use strict'
var validate = require('aproba')
var log = require('npmlog')

var pulsers = 0
var pulse

module.exports = function (prefix, cb) {
  validate('SF', [prefix, cb])
  if (!prefix) prefix = 'network'
  if (!pulsers++) {
    pulse = setInterval(function () {
      log.gauge.pulse(prefix)
    }, 250)
  }
  return function () {
    if (!--pulsers) {
      clearInterval(pulse)
    }
    cb.apply(null, arguments)
  }
}