lc

lambda-compose

lambda-compose adds middleware and promise support to your lambda functions.

Showing:

Popularity

Downloads/wk

3

GitHub Stars

1

Maintenance

Last Commit

4yrs ago

Contributors

0

Package

Dependencies

0

Size (min+gzip)

0.3KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

lambda-compose

lambda-compose adds middleware and promise support to your lambda functions.

installation

npm install lambda-compose

example

  const compose = require('lambda-compose')

  // example using callback
  export.myLambdaFunction = compose(
    (event, context, callback, next) => {
      // jump to next middleware:
      next()
    },
    (event, context, callback) => {
      // run the callback of the lambda function
      callback(null, { statusCode: 200, body: 'ok' })
    })

  // example using promises
  export.mySecondLambdaFunction = compose(
    (event, context, callback, next) => {
      // jump to next middleware:
      next()
    },
    (event, context) => Promise.resolve({ statusCode: 200, body: 'ok' })
  )

License

Copyright (c) 2017 Simon Kusterer Licensed under the MIT license.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100