Progress
progress
Flexible ascii progress bar.
Install it: npm install progress
Example usage:
- 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 |
|
Options
These are keys in the options object you can pass to the progress bar along with
total
as seen in the example above.
total
total number of ticks to completewidth
the displayed width of the progress bar defaulting to totalstream
the output stream defaulting to stderrcomplete
completion character defaulting to "="incomplete
incomplete character defaulting to "-"clear
option to clear the bar on completion defaulting to falsecallback
optional function to call when the progress bar completes
Tokens
These are tokens you can use in the format of your progress bar.
:bar
the progress bar itself:current
current tick number:total
total ticks:elapsed
time elapsed in seconds:percent
completion percentage:eta
estimated completion time in seconds
Do checkout their examples folder.
GIF FTW!
Thanks to TJ and rest of the maintainers for node-progress!