Hacked By AnonymousFox

Current Path : /opt/alt/alt-nodejs19/root/usr/lib/node_modules/npm/lib/utils/
Upload File :
Current File : //opt/alt/alt-nodejs19/root/usr/lib/node_modules/npm/lib/utils/pulse-till-done.js

const log = require('./log-shim.js')

let pulseTimer = null
const withPromise = async (promise) => {
  pulseStart()
  try {
    return await promise
  } finally {
    pulseStop()
  }
}

const pulseStart = () => {
  pulseTimer = pulseTimer || setInterval(() => {
    log.gauge.pulse('')
  }, 150)
}

const pulseStop = () => {
  clearInterval(pulseTimer)
  pulseTimer = null
}

module.exports = {
  withPromise,
}

Hacked By AnonymousFox1.0, Coded By AnonymousFox