@salte-io/salte-lambda

2.0.1 • Public • Published

Salte Lambda

NPM Version NPM Downloads CI Build Coveralls

semantic-release

An opinionated wrapper for AWS Lambda that enables the use of Promises.

Install

You can install this package either with npm.

npm

$ npm install @salte-io/salte-lambda

Usage

const wrapper = require('@salte-io/salte-lambda');

exports.handler = wrapper((event, context) => {
  if (!event.body.myAttribute) {
    return Promise.reject({
      statusCode: 400,
      code: 'missing_my_attribute',
      message: '"myAttribute" is required!'
    });
  }

  return Promise.resolve({
    my_attribute: event.body.myAttribute
  });
});

Package Sidebar

Install

npm i @salte-io/salte-lambda

Weekly Downloads

6

Version

2.0.1

License

MIT

Unpacked Size

13.2 kB

Total Files

11

Last publish

Collaborators

  • cecilia-sanare
  • salte-bot
  • davewoodward