Skip to content
This repository has been archived by the owner on May 5, 2022. It is now read-only.

salte-io/salte-lambda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
  });
});

About

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

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •