Skip to content

Instantly share code, notes, and snippets.

@beenotung
Created February 18, 2019 05:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beenotung/a8bea453a2384c3e8bd95d0e70d03dac to your computer and use it in GitHub Desktop.
Save beenotung/a8bea453a2384c3e8bd95d0e70d03dac to your computer and use it in GitHub Desktop.
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