Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
demo of npm package progress for cli progress bar
var ProgressBar = require('progress');
var bar = new ProgressBar(' demo-ing progress [:bar] :percent :etas',{
complete: '=',
incomplete: ' ',
width: 20,
total: 100,
});
var timer = setInterval(()=>{
if(bar.curr<bar.total) {
bar.tick(1);
} else {
clearInterval(timer);
}
},100);
module.exports = bar;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment