API/api.medcify.app/node_modules/pm2-multimeter/example/drop.js
2022-09-26 11:41:44 +05:30

24 lines
522 B
JavaScript

var multimeter = require('multimeter');
var multi = multimeter(process);
multi.on('^C', function () {
multi.charm.cursor(true);
multi.write('\n').destroy();
process.exit();
});
multi.charm.cursor(false);
multi.drop(function (bar) {
var iv = setInterval(function () {
var p = bar.percent();
bar.percent(p + 1);
if (p >= 100) {
clearInterval(iv);
multi.charm.cursor(true);
multi.write('\n').destroy();
}
}, 25);
});