aws-lambda-helper
Advanced tools
Comparing version 2.1.0 to 2.1.1
{ | ||
"name": "aws-lambda-helper", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "Collection of helper methods for lambda", | ||
"main": "src/index.js", | ||
"main": "lib/index.js", | ||
"scripts": { | ||
@@ -7,0 +7,0 @@ "nocov": "node ./node_modules/.bin/mocha test/*/*.js", |
# aws-lambda-helper | ||
Collection of helper methods for lambda | ||
[](https://travis-ci.org/tcdl/aws-lambda-helper) | ||
[](https://codecov.io/github/tcdl/aws-lambda-helper?branch=master) | ||
[](https://travis-ci.org/numo-labs/aws-lambda-helper) | ||
[](https://codecov.io/github/numo-labs/aws-lambda-helper?branch=master) | ||
@@ -14,9 +14,12 @@ ## Installation | ||
var AwsHelper = require('aws-lambda-helper'); | ||
var AWS = require('aws-sdk'); | ||
//Initialise the helper by passing in aws-sdk and context | ||
var awsHelper = AwsHelper(AWS, context); | ||
exports.handler = function(event, context) { | ||
... | ||
//Initialise the helper by passing in the context | ||
var awsHelper = AwsHelper(context); | ||
... | ||
} | ||
``` | ||
### Invoke a Lamda function | ||
### Invoke a Lamda function | ||
@@ -30,6 +33,6 @@ ```javascript | ||
// assume : context.invokedFunctionArn = invokedFunctionArn: 'arn:aws:lambda:eu-west-1:123456789:function:mylambda:prod' | ||
//Initialise the helper by passing in aws-sdk and context | ||
var awsHelper = AwsHelper(AWS, context); | ||
//Initialise the helper by passing in the context | ||
var awsHelper = AwsHelper(context); | ||
console.log(awsHelper.env); //prints: prod | ||
@@ -49,2 +52,4 @@ console.log(awsHelper.region); //prints: eu-west-1 | ||
} | ||
`` | ||
``` | ||
### Invoke a Lamda function |
107550
53