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

lambda-wrapper

Package Overview
Dependencies
Maintainers
2
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.1.2 to 0.2.0

.travis.yml

29

index.js

@@ -65,2 +65,3 @@ 'use strict';

} catch (ex) {
callback(ex);
throw (ex);

@@ -71,4 +72,11 @@ }

run(event, callback) {
return this.runHandler(event, {}, callback);
run(event, context, callback) {
let callbackFunction = callback;
let contextObject = context;
if (typeof context === 'function') {
// backwards compability
callbackFunction = context;
contextObject = {};
}
return this.runHandler(event, contextObject, callbackFunction);
}

@@ -96,11 +104,18 @@ }

},
run: (event, callback) => new Promise((resolve, reject) => {
run: (event, context, callback) => new Promise((resolve, reject) => {
let callbackFunction = callback;
let contextObject = context;
if (typeof context === 'function') {
// backwards compability
callbackFunction = context;
contextObject = {};
}
if (typeof latest === typeof undefined) {
const error = 'Module not initialized';
reject(error);
return callback(error, null);
return callbackFunction(error, null);
}
return latest.run(event, (err, data) => {
if (callback) {
return callback(err, data);
return latest.run(event, contextObject, (err, data) => {
if (callbackFunction) {
return callbackFunction(err, data);
}

@@ -107,0 +122,0 @@ if (err) {

{
"name": "lambda-wrapper",
"version": "0.1.2",
"version": "0.2.0",
"description": "Wrapper for running Amazon Lambda modules locally",
"main": "index.js",
"scripts": {
"test": "mocha"
"test": "RUN_LIVE=true npm run unit-tests",
"unit-tests": "./node_modules/.bin/mocha"
},

@@ -33,4 +34,3 @@ "repository": {

},
"dependencies": {
}
"dependencies": {}
}
# lambda-wrapper
[![Build Status](https://travis-ci.org/SC5/lambda-wrapper.svg?branch=master)](https://travis-ci.org/SC5/lambda-wrapper)
Wrapper for running lambda modules locally or from AWS during development

@@ -34,2 +37,4 @@

Documentation for valid propreties in the Lambda context object are documented here http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-context.html
Exceptions from within the module will be returned as errors via the callback / promise.

@@ -47,2 +52,4 @@ ## Development

* 2017/07/09 - v0.2.0 - Return exceptions as errors via callback
* 2017/06/16 - v0.1.3 - Allow context object in run
* 2016/10/21 - v0.1.2 - Support for using promises

@@ -58,6 +65,3 @@ * 2016/07/26 - v0.1.1 - Support for alternative handler. runHandler method for passing custom context.

Copyright (c) 2015 [SC5](http://sc5.io/), licensed for users and contributors under MIT license.
https://github.com/SC5/aws-document-cache/blob/master/LICENSE
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/SC5/lambda-local/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
Copyright (c) 2016 [SC5](http://sc5.io/), licensed for users and contributors under MIT license.
https://github.com/SC5/lambda-wrapper/blob/master/LICENSE

Sorry, the diff of this file is not supported yet

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