Last active
March 27, 2018 21:34
-
-
Save mpayetta/f57a5151d0ab87efede0b9e4ccecb150 to your computer and use it in GitHub Desktop.
get-s3-file.js
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
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