Skip to content

A class to invoke an AWS Lambda function from an other

License

Notifications You must be signed in to change notification settings

Palmabit-IT/lambda-invoker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lambda invoker

Build Status Known Vulnerabilities https://david-dm.org/Palmabit-IT/lambda-invoker.svg

A class to invoke an AWS Lambda function from an other

Installation

npm install lambda-invoker --save

Usage

Callback

const AWS = require('aws-sdk')
const LambdaInvoker = require('lambda-invoker')

const invoker = new LambdaInvoker(new AWS.Lambda())

invoker.invoke(<lambda-arn>, <payload>, (err, data) => {
    //...
})

Promise

invoker.invoke(<lambda-arn>, <payload>)
    .then(response => { /*...*/ })
    .catch(err => { /*...*/ })

Errors

No lambda arn name provided

{statusCode: 400, message: "No function name"}

No payload response from invoked lambda

{statusCode: 400, message: "Can't get payload"}

Errors from invoked lambda

{statusCode: <status-code-from-lambda>, message: <error-message-from-lambda>}

Tests

npm test

Coverage

npm run-script test-travis

Author

Palmabit

License

MIT license

About

A class to invoke an AWS Lambda function from an other

Resources

License

Stars

Watchers

Forks

Packages

No packages published