I have a stream that reads filenames from a directory, and in the data callback I load the files and do some processing on them. The stream however emits end as soon as the file list has been read, which is long before I've actually processed the input and called all the .ticks() I need.
I therefore needed a callback that I could be sure was run when the processing of all the files was actually done. This seemed like a nice solution, not making me have to implement counters and stuff when the progress bar already has 'em :)
Add a callback option to the progress bar.
Update Readme accordingly.
Fix typo in Readme.
Just realized I completely missed the usage example that checks .complete after calling .tick().
Having a callback function could still be useful if .tick() is called from a different context then the one the bar is created in though.
It's up to you TJ! :D
Is this thing still maintained? ^^
@simme it is now, gonna take a look at this
I could live with this, but the callback option should default to null, not false, since it's not a boolean
options.callback || null
Yeah, I agree.
Will you update the PR?
Fix default callback value.
There you go!
Landed in 0867c0a. Thanks!