Skip to content

Instantly share code, notes, and snippets.

@mpayetta
Last active Mar 27, 2018
Embed
What would you like to do?
get-s3-file.js
function getS3File(bucket, key) {
return new Promise(function(resolve, reject) {
s3.getObject(
{
Bucket: bucket,
Key: key
},
function (err, data) {
if (err) return reject(err);
else return resolve(data);
}
);
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment