Skip to content

Wrapper around request module that shows info about current download

License

Notifications You must be signed in to change notification settings

wilkoklak/request-download-info

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

request-download-info

This module is a wrapper around request module.

It provides progress event that shows current of the download like it's speed, ETA, percentage etc.

Installation

You have to install request module:

npm install request --save

Then you need to install this module:

npm install request-download-info --save

Usage

const request = require('request')
const RequestInfo = require('request-download-info')
const fs = require('fs')

let info = new RequestInfo(
  request('http://releases.ubuntu.com/16.04.3/ubuntu-16.04.3-desktop-amd64.iso')
)
info.on('progress', status => {
  console.log(status)
}).pipe(fs.createWriteStream('ubuntu.iso'))

The above example downloads Ubuntu iso from official page, to ubuntu.iso in current directory and prints status of download each second (by default).

Documentation

See Documentation here

About

Wrapper around request module that shows info about current download

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published