dl-file-new
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

download-file-new

This creates a d.ts file so you can use it in your typescript project. Used by sern CLI.

Install

npm install download-file-new

Usage

var download = require('dl-file-new')

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

Package Sidebar

Install

npm i dl-file-new

Weekly Downloads

0

Version

1.0.1

License

ISC

Unpacked Size

2.88 kB

Total Files

4

Last publish

Collaborators

  • srizan