0.0.2 • Published 7 years ago

lambdacadabra v0.0.2

Weekly downloads
2
License
ISC
Repository
github
Last release
7 years ago

lambdacadabra

This is a simple library that transforms any function into an AWS Lambda handler.

Installation

$ npm install --save lambdacadabra

First, define the function that will be turned into a handler. That function will be called with the lambda's payload and context:

const doSomeWork = (payload, context) => 'Hello, World!';

Then use lambdacadabra to turn that function into a handler:

module.exports.handler = lambdacadabra(doSomeWork);

The return value of the function will be passed as the second parameter to the AWS Lambda's callback function. If an error is thrown while executing the function, it will be caught and passed as the first parameter to that callback.

lambdacadabra will also log errors, including the offending payload. To take advantage of that feature, make sure your lambda's execution role has permissions to write to CloudWatch Logs.

0.0.2

7 years ago

0.0.1

7 years ago