Get unlimited public & private packages + team-based management with npm Teams.Learn more »

downit

2.0.0 • Public • Published

Downit - Resume downloads in node

Downit simply downloads a file from a URL to a destination on the disk, resuming previous progress if the server supports the Range header.

Install

npm i downit

Usage

downit(url, dest, [options])

const downit = require('downit')
 
downit(url, dest, {
  headers: { Authorization: 'Bearer Of Good News' },
  progress: (got, total) => console.log('Got ', got, 'B of ', total, 'B'),
  onrequest: req => { /* The node request instance */ },
  onresponse: res => { /* The node response instance */ }
}).then(() => {
  console.log('Downed it')
}).catch(e => {
  console.error('Dropped it, due to ', e)
})

CLI

Downit also works on the command line.

Installation

npm i downit -g

Usage

downit url [dest]

Install

npm i downit

DownloadsWeekly Downloads

1

Version

2.0.0

License

WTFPL

Unpacked Size

4.71 kB

Total Files

4

Last publish

Collaborators

  • avatar