Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save anderson-marques/1428858e2d453fc3e1ff6bff1ae53c78 to your computer and use it in GitHub Desktop.

Select an option

Save anderson-marques/1428858e2d453fc3e1ff6bff1ae53c78 to your computer and use it in GitHub Desktop.
AWS S3 SDK v3 - GetObjectCommandOutput - How to get the content from Readable
const input:GetObjectRequest = {
Bucket: this.eventsBucket,
Key: `${request.eventName}/${request.eventId}`
}
const command = new GetObjectCommand(input);
const output = await this.s3Client.send(command)
let outputBody: string = ''
for await (let chunk of output.Body as Readable) {
outputBody += chunk
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment