The S3 client for v3 of the SDK signature has changed when trying to create a read stream.
The signature has changed so that instead of
|
stream: function(offset,length) { |
|
var d = {}; |
|
for (var key in params) |
|
d[key] = params[key]; |
|
d.Range = 'bytes='+offset+'-' + (length ? length : ''); |
|
return client.getObject(d).createReadStream(); |
|
} |
, it would have to look something like
stream: function(offset,length) {
var d = {};
for (var key in params)
d[key] = params[key];
d.Range = 'bytes='+offset+'-' + (length ? length : '');
return new Promise(function(resolve,reject) {
client.getObject(d, function(err, data) {
if (err)
reject(err);
else
resolve(data.Body);
});
});
}
, although it's unclear how to distinguish between a v2 client and a v3 client and if the caller would be happy with a Promise being returned instead of the stream directly.
If a v3 client is passed in, the following error is thrown in the current version of unzipper:
ERROR TypeError: client.getObject(...).createReadStream is not a function
The S3 client for v3 of the SDK signature has changed when trying to create a read stream.
The signature has changed so that instead of
node-unzipper/lib/Open/index.js
Lines 86 to 92 in 7f83183
, although it's unclear how to distinguish between a v2 client and a v3 client and if the caller would be happy with a Promise being returned instead of the stream directly.
If a v3 client is passed in, the following error is thrown in the current version of
unzipper: