0.0.1 • Published 6 years ago

lambda-cb-to-promise v0.0.1

Weekly downloads
1
License
ISC
Repository
github
Last release
6 years ago

lambda-cb-to-promise

support to promises in aws lambda

Usage

const promiseHandler = require('lambda-cb-to-promise')
const awsHanlder = (eventFromAws, ctxFromAws, cbToCheckIfPromiseIsReturned) => {
 // lambda function is here
 // you can return a promise
 return Promise.resolve({})
 // or you can call the callback
 cbToCheckIfPromiseIsReturned('error', null)
}
const handlerToAwsLambda = promiseHandler(awsHanlder)

API promiseHandler(awsHandler) -> handlerWithPromiseSupport