lambda-local
Advanced tools
Comparing version 0.0.9 to 0.0.10
# ChangeLog | ||
## 0.0.9 (2016/4/9) | ||
* Fixed package.json information for npm | ||
## 0.0.8 (2016/4/9) | ||
@@ -4,0 +7,0 @@ * Added support for all propertiesin the Context object. |
@@ -11,4 +11,5 @@ /* | ||
context.done(null, 'Hello World'); // SUCCESS with message | ||
console.log('still running!'); | ||
}; | ||
@@ -26,3 +26,3 @@ /* | ||
*/ | ||
module.exports = Context; | ||
module.exports = exports = Context; | ||
@@ -32,2 +32,3 @@ /* | ||
*/ | ||
Context.callbackWaitsForEmptyEventLoop = true; | ||
Context.functionName = ''; | ||
@@ -69,5 +70,8 @@ Context.functionVersion = '1'; | ||
Context.functionName = options.functionName; | ||
/* set requestid */ | ||
Context.awsRequestId = options.awsRequestId; | ||
/* Set callbackWaitsForEmptyEventLoop */ | ||
Context.callbackWaitsForEmptyEventLoop = options.callbackWaitsForEmptyEventLoop; | ||
return; | ||
@@ -86,4 +90,3 @@ } | ||
utils.outputJSON(err); | ||
} | ||
else { | ||
} else { | ||
console.log("Message"); | ||
@@ -93,4 +96,5 @@ console.log("------"); | ||
} | ||
process.exit(); | ||
if(!Context.callbackWaitsForEmptyEventLoop){ | ||
process.exit(); | ||
} | ||
}; | ||
@@ -120,3 +124,1 @@ | ||
}; | ||
@@ -32,1 +32,24 @@ /* | ||
//This will load aws creditentials files | ||
//more infos: http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#cli-config-files | ||
Utils.loadAWSFile = function (path){ | ||
var fs = require('fs'); | ||
var data_raw = fs.readFileSync(path); | ||
var data = data_raw.toString(); | ||
var regex = /\[default\](.|\n)*?aws_secret_access_key=(.*)/; | ||
var match = regex.exec(data); | ||
if(match[2]){ | ||
process.env['AWS_SECRET_ACCESS_KEY'] = match[2]; | ||
} else { | ||
console.log("WARNING: Couldn't find the \"aws_secret_access_key\" field inside the file."); | ||
} | ||
regex = /\[default\](.|\n)*?aws_access_key_id=(.*)/; | ||
match = regex.exec(data); | ||
if(match[2]) { | ||
process.env['AWS_ACCESS_KEY_ID'] = match[2]; | ||
} else { | ||
console.log("WARNING: Couldn't find the \"aws_access_key_id\" field inside the file."); | ||
} | ||
} |
{ | ||
"name": "lambda-local", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"description": "Commandline tool to run Lambda functions on your local machine.", | ||
"keywords": [ | ||
"lambda", | ||
"amazon", | ||
"amazon", | ||
"aws", | ||
@@ -20,2 +20,3 @@ "AWS", | ||
"commander": "^2.6.0", | ||
"fs": "^0.0.2", | ||
"mocha": "^2.4.5" | ||
@@ -22,0 +23,0 @@ }, |
@@ -31,2 +31,4 @@ Lambda-local | ||
* -t, --timeout [timeout seconds (optional)] Seconds until lambda function timeout. Default is 3 seconds. | ||
* -c, --callbackforce (optional) Force the function to stop after having called context.done/succeed/fail. | ||
* -p, --profile [aws file path (optional)] Read the AWS profile to get the credidentials. | ||
@@ -50,11 +52,5 @@ ### Event data | ||
Since the Amazon Lambda can load the AWS-SDK npm without installation, Lambda-local has also packaged AWS-SDK in its dependencies. | ||
If you want to use this, please manually add Lambda-local's path to NODE_PATH, as well as AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY : | ||
If you want to use this, please use the "-p" option with the aws credentials file. More infos here: | ||
http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#cli-config-files | ||
```bash | ||
export NODE_PATH='/path/to/lambda-local/node_modules' | ||
export AWS_ACCESS_KEY_ID='yourKeyId' | ||
export AWS_SECRET_ACCESS_KEY='yourSecretKey' | ||
``` | ||
License | ||
@@ -61,0 +57,0 @@ ---------- |
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
15458
15
330
4
59
3