Lambda Wrapper for AWS NodeJS Projects
Clone or download

README.md

Lambda Wrapper

CircleCI semantic-release semantic-release

When writing Serverless endpoints, we have found ourselves replicating a lot of the boiler plate code to do basic actions, such as reading request variables or writing to SQS. The aim of this package is to provide a wrapper for our lambda functions, to provide some level of dependency and configuration injection and to reduce time spent on project setup.

Installation & usage

Install via npm:

npm install --save @comicrelief/lambda-wrapper

Or via yarn:

yarn add @comicrelief/lambda-wrapper

You can then wrap your lambdas as follows.

import {
  LambdaWrapper,
  ResponseModel,
  RequestService,
} from '@comicrelief/lambda-wrapper';

export default LambdaWrapper({}, (di, request, done) => {
  const response = new ResponseModel({}, 200, `hello ${request.get('name', 'nobody')}`);
  done(null, response.generate());
});

Semantic release

Release management is automated using semantic-release.