D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
alt-nodejs16
/
root
/
usr
/
lib
/
node_modules
/
npm
/
lib
/
utils
/
Filename :
pulse-till-done.js
back
Copy
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, }