1.0.2 • Published 5 years ago

node-fetch-progress v1.0.2

Weekly downloads
955
License
MIT
Repository
github
Last release
5 years ago

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
  )
})