Registry / testing / node-fetch-progress

node-fetch-progress

JSON →
library1.0.2jsnpmunverified

Node.js library that wraps a fetch Response object to emit download progress events, including bytes done, total, transfer rate, ETA, and human-readable sizes. Version 1.0.2, stable, no longer actively maintained. Key differentiator: simple wrapper around fetch with throttle control, minimal dependencies.

npm install node-fetch-progress
INSTALL
IMPORT
SIG · NODE-FETCH-PROGRES
N
node-fetch-progress
testingjavascriptv1.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Progress
import Progress from 'node-fetch-progress'
const Progress = require('node-fetch-progress')
CJS require works, but default import is more common with modern Node.js.

Demonstrates downloading a file and logging progress every 100ms.

import fetch from 'node-fetch'; import Progress from 'node-fetch-progress'; async function download() { const response = await fetch('https://example.com/largefile.zip'); const progress = new Progress(response, { throttle: 100 }); progress.on('progress', (p) => { console.log(`Downloaded ${p.doneh} of ${p.totalh} (${p.progress}%)`); console.log(`Rate: ${p.rateh}, ETA: ${p.etah}`); }); } download();
Debug
Known issues
gotchaProgress must be instantiated with a Response object that has a body (ReadableStream). Non-streaming responses will not emit progress.
fix
Ensure the fetch URL points to a resource with a Content-Length header and supports streaming.
affects: >=1.0.0
gotchaThrottle option defaults to 1000ms (1 second) if omitted, which may cause infrequent updates.
fix
Set throttle to a lower value like 100 for smoother progress events.
affects: >=1.0.0
gotchaThe 'progress' event only fires after the first chunk is received. If the response finishes before any data, no progress event is emitted.
fix
Listen for 'end' or 'error' events as well.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: response.body is not a readable stream
Response does not have a body (e.g., no body in response, or fetch polyfill not used correctly).
fix
Ensure fetch returns a response with a body property. Use node-fetch or native fetch in Node 18+.
Progress is not a constructor
Importing incorrectly (e.g., named import instead of default).
fix
Use default import: import Progress from 'node-fetch-progress'
Upgrade
Version history
1.0.2latest on npm
Audit
Dependencies
node-fetchoptionalAssumes fetch API (native or polyfill) for Response object.
Agent activity
4 hits · last 30 days
node
4
Resources
node-fetch-progress — npm install node-fetch-progress · libregistry