A class to invoke an AWS Lambda function from an other
npm install lambda-invoker --save
const AWS = require('aws-sdk')
const LambdaInvoker = require('lambda-invoker')
const invoker = new LambdaInvoker(new AWS.Lambda())
invoker.invoke(<lambda-arn>, <payload>, (err, data) => {
//...
})
invoker.invoke(<lambda-arn>, <payload>)
.then(response => { /*...*/ })
.catch(err => { /*...*/ })
{statusCode: 400, message: "No function name"}
{statusCode: 400, message: "Can't get payload"}
{statusCode: <status-code-from-lambda>, message: <error-message-from-lambda>}
npm test
npm run-script test-travis