async-get-file : Download files with Promise (Node.js)
This package is a wrapper around the download-file package replacing callback functions with functions that return a Promise.
Basically it lets you write code like this
await ;console;
instead of
Installation
Basic Usage
const async = ;const get = ; { var url = "http://i.imgur.com/G9bDaPH.jpg"; var options = directory: "./images/cats/" filename: "cat.gif" await ;} ;
Or
const Promise = ;const get = ; var url = "http://i.imgur.com/G9bDaPH.jpg";var options = directory: "./images/cats/" filename: "cat.gif" ;
API
get(url, [options])
-
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)
References
License
async-get-file is published under the MIT license. For more information, see the accompanying LICENSE file.