Created
July 26, 2020 14:00
-
-
Save wingkwong/0ddde335639667ec49c0f700edefd262 to your computer and use it in GitHub Desktop.
Converting errant callback-based functions to promised-based ones to avoid AWS Lambda execution leaks
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
exports.handler = async (event, context) => { | |
const readFileAsync = util.promisify(readFile); | |
const result = await readFileAsync('foo.json') | |
return result; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment