Download and extract files
See download-cli for the command-line version.
$ npm install --save download
If you're fetching an archive you can set extract: true
in options and
it'll extract it for you.
var Download = require('download');
new Download({mode: '755'})
.get('http://example.com/foo.zip')
.get('http://example.com/cat.jpg')
.dest('dest')
.run();
Creates a new Download
instance.
Type: object
Options for got
or the underlying http
/https
request can be specified,
as well as options specific to the download
module as described below.
Type: boolean
Default: false
If set to true
, try extracting the file using decompress.
Type: string
Set mode on the downloaded file, i.e {mode: '755'}
.
Type: number
Default: 0
Remove leading directory components from extracted files.
Type: string
Add a URL to download.
Type: string
Set an optional destination folder that will take precedence over the one set in
.dest()
.
Type: string
Set the destination folder to where your files will be downloaded.
Type: function
or string
Rename your files using gulp-rename.
Type: function
Add a plugin to the middleware stack.
The response object.
The requested URL.
Type: function
Contains an array of vinyl files.
MIT © Kevin Mårtensson