node-fetch-progress

Get updates on download progress using `fetch`.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
node-fetch-progress
1.0.25 years ago5 years agoMinified + gzip package size for node-fetch-progress in KB

Readme

node-fetch-progress
Get updates on download progress using fetch.

Install

Using yarn
yarn add node-fetch-progress

Using npm
npm install node-fetch-progress --save

Usage

const response = await fetch(link)
const progress = new Progress(response, { throttle: 100 })
progress.on('progress', (p) => {
  console.log(
    p.total,
    p.done,
    p.totalh,
    p.doneh,
    p.startedAt,
    p.elapsed,
    p.rate,
    p.rateh,
    p.estimated,
    p.progress,
    p.eta,
    p.etah,
    p.etaDate
  )
})