s3-download-stream
Advanced tools
Comparing version 1.0.0 to 1.1.1
@@ -47,3 +47,2 @@ var Readable = require('stream').Readable; | ||
self.done = result.data === null; | ||
if (!self.done) self.done = result.contentLength < self.chunkSize; | ||
self.push(result.data); | ||
@@ -54,3 +53,2 @@ } | ||
S3Readable.prototype._read = function(numBytes) { | ||
if (this.done) return; | ||
var toQueue = this.concurrency - this.queue._queue.length; | ||
@@ -64,3 +62,3 @@ for (var i = 0; i < toQueue; ++i) | ||
var params = clone(this.params) | ||
var rng = params.Range = range(from, numBytes); | ||
var rng = params.Range = range(from, numBytes) | ||
var req = self.client.getObject(params, function(err, res){ | ||
@@ -71,3 +69,3 @@ // range is past EOF, can return safely | ||
var contentLength = +res.ContentLength; | ||
var data = contentLength === 0 ? null : res.Body; | ||
var data = contentLength === 0? null : res.Body; | ||
done(null, {range: rng, data: data, contentLength: contentLength}); | ||
@@ -74,0 +72,0 @@ }); |
@@ -7,3 +7,3 @@ { | ||
], | ||
"version": "1.0.0", | ||
"version": "1.1.1", | ||
"license": "MIT", | ||
@@ -10,0 +10,0 @@ "repository": { |
# s3-download-stream | ||
[![Build Status](https://travis-ci.org/jb55/s3-download-stream.svg)](https://travis-ci.org/jb55/s3-download-stream) | ||
Very fast concurrent + streaming downloads from S3 | ||
@@ -5,0 +7,0 @@ |
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
6736
84
110