@vbarbarosh/node-helpers 3.5.1 → 3.5.2

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/pv.js +2 -2
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "author": "Vladimir Barbarosh <vladimir.barbarosh@gmail.com>",
3
3
  "license": "MIT",
4
4
  "name": "@vbarbarosh/node-helpers",
5
- "version": "3.5.1",
5
+ "version": "3.5.2",
6
6
  "description": "A set of helpers for JavaScript/Node.js",
7
7
  "files": [
8
8
  "src"
package/src/pv.js CHANGED
@@ -13,8 +13,8 @@ async function* pv(stream, {total, resumed, log = s => console.log(s)})
13
13
  read += chunk.length;
14
14
  const seconds = (Date.now() - time0)/1000;
15
15
  const bps = read/seconds;
16
- if (resumed) {
17
- const done = read + resumed;
16
+ if (total) {
17
+ const done = read + (resumed || 0);
18
18
  log(`${format_bytes(done)} of ${format_bytes(total)} at ${format_bytes(bps)}/s ETA ${eta(time0, total, done, resumed)}`);
19
19
  }
20
20
  else {