stream-s3-object
Usage
const AWS = const streamS3Object = const s3 = const getObjectRequest = s3const getHeader headers stream = await
Returned properties
The function returns an object containing the following properties asynchronously (i.e. as a Promise):
getHeader(name: string): string?
- Get the string value of the specified header name (or
undefined
), with case-insensitive matching
- Get the string value of the specified header name (or
headers: { [name: string]: string }
- The exact headers object returned from the AWS SDK
stream: stream.Readable
- A readable stream representing the S3 object being retrieved, from
s3.getObject(...).createReadStream()
- A readable stream representing the S3 object being retrieved, from
Errors
The streamS3Object()
call will throw a TypeError
synchronously if the input doesn't appear to be a request object from the s3 getObject()
method. The returned Promise will be rejected with the error value from any httpError
event that is raised on the getObject()
request.
See Also
- AWS SDK docs for S3