Skip to content

Feature request: support for aws-sdk v3 #241

@neverendingqs

Description

@neverendingqs

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions