Cheap, functional, terminal progress bar.
Next time you're tempted to
process.stderr.write('.') to track the progress of a script... don't. Use this instead.
progress : Object -> Number -> ()
To setup your progress bar, execute the module with an optional options object:
const progress = /* options here */
The following options are accepted:
||custom label for your progress bar|
||output stream for progress|
||max width of the bar|
The returned function accepts a progress ratio between
1, and writes the progress bar to the output stream. Each time it is called, it will overwrite the previous state of the progress to appear animated in the console.
const progress =//> progress: ⣠ [============== ] 55%
demo.js for a slightly more complex example.