You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

23 lines
541 B

'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)
}
}