Comparing version 0.1.5 to 0.1.6
@@ -18,2 +18,3 @@ 'use strict'; | ||
* - `mode` Set mode on the downloaded files | ||
* - `strip` Equivalent to --strip-components for tar | ||
* | ||
@@ -33,2 +34,3 @@ * @param {String|Array} url | ||
opts.dest = path.join(dest, path.basename(url)); | ||
opts.strip = opts.strip || '0'; | ||
@@ -56,3 +58,3 @@ var req = request.get(opts) | ||
if (opts.extract && decompress.canExtract(url, mime)) { | ||
end = decompress.extract({ ext: mime, path: dest }); | ||
end = decompress.extract({ ext: url, path: dest, strip: opts.strip }); | ||
} else { | ||
@@ -59,0 +61,0 @@ if (!fs.existsSync(dest)) { |
{ | ||
"name": "download", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "Download and extract files effortlessly", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -18,6 +18,6 @@ # download [![Build Status](https://secure.travis-ci.org/kevva/download.png?branch=master)](http://travis-ci.org/kevva/download) | ||
// download and extract `foo.tar.gz` into `bar/` | ||
download('foo.tar.gz', 'bar', { extract: true; }); | ||
download('foo.tar.gz', 'bar', { extract: true }); | ||
// download and save `foo.exe` into `bar/foo.exe` with mode `0755` | ||
download('foo.exe', 'bar', { mode: 0755 }); | ||
download('foo.exe', 'bar', { mode: '0755' }); | ||
@@ -37,3 +37,5 @@ // download and save an array of files in `bar/` | ||
* `extract` — If set to `true`, try extracting the file using [decompress](https://github.com/kevva/decompress/). | ||
* `extract` — If set to `true`, try extracting the file using [decompress](https://github.com/kevva/decompress/) | ||
* `mode` — Set mode on the downloaded files | ||
* `strip` — Equivalent to `--strip-components` for tar | ||
@@ -40,0 +42,0 @@ You can also define options accepted by the [request](https://github.com/mikeal/request/) module. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4250
65
45