Socket
Socket
Sign inDemoInstall

download

Package Overview
Dependencies
Maintainers
3
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

download - npm Package Compare versions

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": "*"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc