mirror of
https://github.com/nodejs/node.git
synced 2025-05-13 14:51:50 +00:00

Contains the following npm releases: - https://github.com/npm/npm/releases/tag/v3.9.6 - https://github.com/npm/npm/releases/tag/v3.10.0 - https://github.com/npm/npm/releases/tag/v3.10.1 - https://github.com/npm/npm/releases/tag/v3.10.2 PR-URL: https://github.com/nodejs/node/pull/7410 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
23 lines
426 B
JavaScript
23 lines
426 B
JavaScript
'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)
|
|
}
|
|
}
|