dwn

0.0.2 • Public • Published

dwn

A simple tool for downloading via node.js

Base code partly copied from hughsk/nw-download

Command Line

$ npm install -g dwn
$ dwn http://example.com/logo.png
$ dwn http://example.com/logo.png cache/
$ dwn http://example.com/logo.png cache/boy.png

Nodejs Library

var dwn = require('dwn')
dwn({
  uri: 'http://example.com/logo.png',  // required
  progress: function(v){},  // eg. 15%, v=0.15
  callback: function(err, buf){}  // buffer
})

or with stream:

var stream = dwn._download(uri)
stream.on('progress', function(v){
  console.log('progress:', v)
})
stream.on('end', done)
stream.on('error', done)
stream.pipe(createWriteStream(dest))

Readme

Keywords

Package Sidebar

Install

npm i dwn

Weekly Downloads

5

Version

0.0.2

License

none

Last publish

Collaborators

  • fritx