Created
April 27, 2021 16:18
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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