-
Notifications
You must be signed in to change notification settings - Fork 223
Open
Description
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.:
import prettyBytes from 'pretty-bytes';
const bar = new ProgressBar(' downloading [:bar] :rate/sec :percent :etas', {
complete: '=',
incomplete: ' ',
width: 20,
total: totalBytes,
rateFormat: prettyBytes, // <--- using third-party formatter
});This will output byte rate in a user-friendly fashion, e.g.: 1.56 MB/sec.
Thanks!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels