1.0.2 • Published 9 years ago

nodeify_lambda_context v1.0.2

Weekly downloads
3
License
ISC
Repository
github
Last release
9 years ago

#Nodeify Lambda Context

##This module is not needed anymore. Lambda context objects have a done callback that behaves the same as a node callback.

Converts an AWS Lambda context object to a node callback.

Build Status

#Setup

npm install nodeify_lambda_context

#Example

	var nodeifyLambdaContext = require('nodeify_lambda_context');

	exports.handler = function(event, context) {
		var callback = nodeifyLambdaContext(context);
		// the context object is now a node callback!
		if (myAppHasAnError()) {
			// calls context.fail(err)
			callback(new Error('Boom!'));
		} else {
			// calls context.succeed()
			callback(null, 'yeah baby!');
		}		
	};