Flexible ascii progress bar.
npm install progress
- Create a ProgressBar.
- Give it a format string.
- Give the total, telling the progress bar when to stop!
- Finally do tick() appropriately.
1 2 3 4 5 6 7 8 9 10
These are keys in the options object you can pass to the progress bar along with
total as seen in the example above.
totaltotal number of ticks to complete
widththe displayed width of the progress bar defaulting to total
streamthe output stream defaulting to stderr
completecompletion character defaulting to "="
incompleteincomplete character defaulting to "-"
clearoption to clear the bar on completion defaulting to false
callbackoptional function to call when the progress bar completes
These are tokens you can use in the format of your progress bar.
:barthe progress bar itself
:currentcurrent tick number
:elapsedtime elapsed in seconds
:etaestimated completion time in seconds
Do checkout their examples folder.