@vbarbarosh/node-helpers 3.21.0 → 3.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/format_progress.js +4 -2
package/package.json
CHANGED
package/src/format_progress.js
CHANGED
|
@@ -4,10 +4,12 @@ const format_seconds = require('./format_seconds');
|
|
|
4
4
|
|
|
5
5
|
function format_progress({percents, total, done, rate, eta, duration})
|
|
6
6
|
{
|
|
7
|
+
const bps = rate ? `${format_bytes(rate)}/s` : '~';
|
|
7
8
|
if (total) {
|
|
8
|
-
|
|
9
|
+
const eta_str = eta ? format_seconds(eta) : '~';
|
|
10
|
+
return `${format_percents(percents)} | ${format_bytes(done)} of ${format_bytes(total)} at ${bps} ETA ${eta_str} duration=${format_seconds(duration)}`;
|
|
9
11
|
}
|
|
10
|
-
return `${format_bytes(done)} of ~ at ${
|
|
12
|
+
return `${format_bytes(done)} of ~ at ${bps} duration=${format_seconds(duration)}`;
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
module.exports = format_progress;
|