AlkantarClanX12

Your IP : 3.139.108.48


Current Path : /opt/alt/alt-nodejs6/root/usr/lib/node_modules/npm/lib/utils/
Upload File :
Current File : //opt/alt/alt-nodejs6/root/usr/lib/node_modules/npm/lib/utils/no-progress-while-running.js

'use strict'
var log = require('npmlog')
var progressEnabled
var running = 0

var startRunning = exports.startRunning = function () {
  if (progressEnabled == null) progressEnabled = log.progressEnabled
  if (progressEnabled) log.disableProgress()
  ++running
}

var stopRunning = exports.stopRunning = function () {
  --running
  if (progressEnabled && running === 0) log.enableProgress()
}

exports.tillDone = function noProgressTillDone (cb) {
  startRunning()
  return function () {
    stopRunning()
    cb.apply(this, arguments)
  }
}