@ydv/function
npm install --save @ydv/function
Creates a wrapper around a Lambda handler.
- Enables promise support. Return a value from the handler, and it's assumed to be 200 OK JSON.
- Sane error handling. Any error object will be passed as response body with error.statusCode || 500.
- Logging on error, adds logger to context
- Calls
options.runBefore(event, context)
before running handler - Automatically parses incoming event.body to object and event.query to object (if applicable)