Last active
October 14, 2021 11:18
-
-
Save SalvoCozzubo/3bc0802d4de270b2bbfc29b920732d45 to your computer and use it in GitHub Desktop.
S3 Stream to String
This file contains 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 streamToString = (stream) => new Promise((resolve, reject) => { | |
const chunks = []; | |
stream.on('data', (chunk) => chunks.push(chunk)); | |
stream.on('error', reject); | |
stream.on('end', () => resolve(Buffer.concat(chunks).toString('utf8'))); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment