lambda-invoker
v0.2.3
Published
A class to invoke a lambda function from an other
Downloads
9
Readme
Lambda invoker
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