Created
February 18, 2019 05:51
-
-
Save beenotung/a8bea453a2384c3e8bd95d0e70d03dac to your computer and use it in GitHub Desktop.
demo of npm package progress for cli progress bar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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