Comparing version 4.2.0 to 4.2.1
16
index.js
@@ -15,3 +15,3 @@ 'use strict'; | ||
var streamCombiner = require('stream-combiner2'); | ||
var through = require('through2'); | ||
var PassThrough = require('readable-stream/passthrough'); | ||
var Vinyl = require('vinyl'); | ||
@@ -124,3 +124,3 @@ var vinylFs = require('vinyl-fs'); | ||
var agent = caw(this.opts.proxy, {protocol: protocol}); | ||
var stream = got(get.url, objectAssign(this.opts, {agent: agent})); | ||
var stream = got.stream(get.url, objectAssign(this.opts, {agent: agent})); | ||
@@ -133,4 +133,14 @@ stream.on('response', function (res) { | ||
var hasHttpError = false; | ||
readAllStream(stream, null, function (err, data) { | ||
if (hasHttpError) { | ||
return; | ||
} | ||
if (err) { | ||
if (err instanceof got.HTTPError) { | ||
hasHttpError = true; | ||
} | ||
done(err); | ||
@@ -183,3 +193,3 @@ return; | ||
Download.prototype.createStream = function (file, dest) { | ||
var stream = through.obj(); | ||
var stream = new PassThrough({objectMode: true}); | ||
var streams = [stream]; | ||
@@ -186,0 +196,0 @@ |
{ | ||
"name": "download", | ||
"version": "4.2.0", | ||
"version": "4.2.1", | ||
"description": "Download and extract files", | ||
@@ -16,3 +16,3 @@ "license": "MIT", | ||
"scripts": { | ||
"test": "node test/test.js" | ||
"test": "xo && ava" | ||
}, | ||
@@ -34,11 +34,11 @@ "files": [ | ||
"filenamify": "^1.0.1", | ||
"got": "^2.3.2", | ||
"got": "^4.2.0", | ||
"gulp-decompress": "^1.0.2", | ||
"gulp-rename": "^1.2.0", | ||
"is-url": "^1.2.0", | ||
"object-assign": "^2.0.0", | ||
"object-assign": "^4.0.1", | ||
"read-all-stream": "^3.0.0", | ||
"readable-stream": "^2.0.2", | ||
"stream-combiner2": "^1.0.2", | ||
"through2": "^2.0.0", | ||
"vinyl": "^0.4.3", | ||
"vinyl": "^0.5.3", | ||
"vinyl-fs": "^1.0.0", | ||
@@ -48,6 +48,7 @@ "ware": "^1.2.0" | ||
"devDependencies": { | ||
"ava": "^0.0.4", | ||
"nock": "^1.2.1", | ||
"rimraf": "^2.2.8" | ||
"ava": "^0.2.0", | ||
"nock": "^2.12.0", | ||
"rimraf": "^2.2.8", | ||
"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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
8234
171
4
1
+ Addedreadable-stream@^2.0.2
+ Addedcapture-stack-trace@1.0.2(transitive)
+ Addedcreate-error-class@2.0.1(transitive)
+ Addederror-ex@1.3.2(transitive)
+ Addedgot@4.2.0(transitive)
+ Addedis-arrayish@0.2.1(transitive)
+ Addedis-plain-obj@1.1.0(transitive)
+ Addedis-redirect@1.0.0(transitive)
+ Addednode-status-codes@1.0.0(transitive)
+ Addedparse-json@2.2.0(transitive)
+ Addedpinkie@1.0.0(transitive)
+ Addedpinkie-promise@1.0.0(transitive)
+ Addedunzip-response@1.0.2(transitive)
- Removedthrough2@^2.0.0
- Removedgot@2.9.2(transitive)
- Removedinfinity-agent@2.0.3(transitive)
- Removednested-error-stacks@1.0.2(transitive)
- Removedread-all-stream@2.2.0(transitive)
- Removedstatuses@1.5.0(transitive)
Updatedgot@^4.2.0
Updatedobject-assign@^4.0.1
Updatedvinyl@^0.5.3