-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support rate formatters #211
Comments
I couldn't really find a solution for this. As the lib seems abandoned, I decided to rewrite it. If the people reading this in the future want to use it, my version includes this functionality |
This is a gravely needed feature. Every now and then I come across a need to display download progress, and I have to copy & paste some boilerplate to add faux tokens to my progress bar: data.on('data', (chunk) => {
let curr = progress.curr + chunk.length;
progress.tick(chunk.length, {'currM': (curr / 1000000).toFixed(2)})
}) @NathanPB's version definitely provides an elegant way to specify these formatters and even includes a library of standard formatters. It is a bit more verbose though for the "regular" tokens and also it cannot be used as a drop-in replacement for |
Hello!
Thank you for this great library!
Right now, library gives no control to how
:rate
is actually formatted. It's pretty standard use case (it's actually used in the README) when bytes are used for total and tick values. However, the library would output rate in plain bytes, which is absolutely unpractical for end users.I would suggest to introduce a rate formatter function, e.g.:
This will output byte rate in a user-friendly fashion, e.g.:
1.56 MB/sec
.Thanks!
The text was updated successfully, but these errors were encountered: