Comparing version 5.0.0 to 5.0.1
37
index.js
@@ -14,26 +14,23 @@ 'use strict'; | ||
const createPromise = (uri, output, stream, opts) => new Promise((resolve, reject) => { | ||
stream.on('response', res => { | ||
const stream = opts.encoding === null ? getStream.buffer(res) : getStream(res, opts); | ||
stream.then(resolve).catch(reject); | ||
}); | ||
const createPromise = (uri, output, stream, opts) => { | ||
const response = opts.encoding === null ? getStream.buffer(stream) : getStream(stream, opts); | ||
stream.on('error', reject); | ||
}).then(data => { | ||
if (!output && opts.extract) { | ||
return decompress(data, opts); | ||
} | ||
return response.then(data => { | ||
if (!output && opts.extract) { | ||
return decompress(data, opts); | ||
} | ||
if (!output) { | ||
return data; | ||
} | ||
if (!output) { | ||
return data; | ||
} | ||
if (opts.extract) { | ||
return decompress(data, path.dirname(output), opts); | ||
} | ||
if (opts.extract) { | ||
return decompress(data, path.dirname(output), opts); | ||
} | ||
return pify(mkdirp)(path.dirname(output)) | ||
.then(() => fsP.writeFile(output, data)) | ||
.then(() => data); | ||
}); | ||
return pify(mkdirp)(path.dirname(output)) | ||
.then(() => fsP.writeFile(output, data)) | ||
.then(() => data); | ||
}); | ||
}; | ||
@@ -40,0 +37,0 @@ module.exports = (uri, output, opts) => { |
{ | ||
"name": "download", | ||
"version": "5.0.0", | ||
"version": "5.0.1", | ||
"description": "Download and extract files", | ||
@@ -29,3 +29,3 @@ "license": "MIT", | ||
"dependencies": { | ||
"caw": "^1.2.0", | ||
"caw": "^2.0.0", | ||
"decompress": "^4.0.0", | ||
@@ -43,2 +43,3 @@ "filenamify": "^1.2.1", | ||
"path-exists": "^3.0.0", | ||
"random-buffer": "^0.1.0", | ||
"rimraf": "^2.2.8", | ||
@@ -45,0 +46,0 @@ "xo": "*" |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
4961
7
47
+ Addedcaw@2.0.1(transitive)
+ Addedconfig-chain@1.1.13(transitive)
+ Addedget-proxy@2.1.0(transitive)
+ Addedhas-symbol-support-x@1.4.2(transitive)
+ Addedhas-to-string-tag-x@1.4.1(transitive)
+ Addedis-object@1.0.2(transitive)
+ Addedisurl@1.0.0(transitive)
+ Addednpm-conf@1.1.3(transitive)
+ Addedproto-list@1.2.4(transitive)
+ Addedtunnel-agent@0.6.0(transitive)
+ Addedurl-to-options@1.0.1(transitive)
- Removedcaw@1.2.0(transitive)
- Removeddeep-extend@0.6.0(transitive)
- Removedget-proxy@1.1.0(transitive)
- Removedis-obj@1.0.1(transitive)
- Removedobject-assign@3.0.0(transitive)
- Removedrc@1.2.8(transitive)
- Removedstrip-json-comments@2.0.1(transitive)
- Removedtunnel-agent@0.4.3(transitive)
Updatedcaw@^2.0.0