df

download-file

Generic file download utility

Showing:

Popularity

Downloads/wk

7.9K

Maintenance

No Maintenance Data Available

Package

Dependencies

1

Size (min+gzip)

0.9KB

License

ISC

Type Definitions

Tree-Shakeable

No?

Readme

download-file

Install

npm install download-file --save

Usage

var download = require('download-file')

var url = "http://i.imgur.com/G9bDaPH.jpg"

var options = {
    directory: "./images/cats/",
    filename: "cat.gif"
}

download(url, options, function(err){
    if (err) throw err
    console.log("meow")
}) 

API

download(url, [options], callback(err))

  • url string of the file URL to download

  • options object with options

    • directory string with path to directory where to save files (default: current working directory)
    • filename string for the name of the file to be saved as (default: filename in the url)
    • timeout integer of how long in ms to wait while downloading (default: 20000)
  • callback function to run after

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Tutorials

No tutorials found
Add a tutorial