Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lambda-wrapper

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lambda-wrapper - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

.jscsrc

56

index.js
// Pseudowrapper for AWS Lambda
//
var lambdaModule;
var _runner = function(event, callbackFn) {
if (!lambdaModule) {
return callbackFn('Module not initialized',null);
}
var _runner = function(event, callback) {
if (!lambdaModule) {
return callback('Module not initialized', null);
}
var lambdacontext = {
succeed : function(success) {
return callbackFn(null, success);
},
fail : function(error) {
return callbackFn(error,null);
}
};
try {
lambdaModule.handler(event, lambdacontext);
} catch (ex) {
callbackFn('Exception:' + ex.toString());
}
var lambdacontext = {
succeed: function(success) {
return callback(null, success);
},
fail: function(error) {
return callback(error, null);
}
};
try {
lambdaModule.handler(event, lambdacontext);
} catch (ex) {
callback('Exception:' + ex.toString());
}
};

@@ -27,18 +27,6 @@

module.exports = exports = {
init : function(modName) {
if (!modName) {
modName = '';
}
try {
lambdaModule = require(modName);
// Return the module;
return this;
} catch(ex) {
lambdaModule = require(process.cwd() + '/' + modName);
return this;
}
return null;
},
run: _runner
init: function(mod) {
lambdaModule = mod;
},
run: _runner
};
{
"name": "lambda-wrapper",
"version": "0.0.1",
"version": "0.0.2",
"description": "Wrapper for running Amazon Lambda modules locally",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -8,7 +8,5 @@ # lambda-wrapper

// Loads the default module defined in package.json
var lambda = require('lambda-wrapper').init();
// Loads the module in myModule/mymod.js
var lambda = require('lambda-wrapper').init('myModule/mymod.js');
var lambdaFunc = require('myModule/mymod.js');
var lambda = require('lambda-wrapper').init(lambdaFunc);

@@ -27,2 +25,4 @@ ### Running the function in the Lambda module

* 2015/09/01 - v0.0.2 - Pass module object rather than path to init().
Removed automatic loading of module.
* 2015/07/23 - v0.0.1 - Initial version of module

@@ -29,0 +29,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc