0.0.1 • Published 9 years ago

local-node-lambda v0.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

Local-Node-Lambda

Local-Node-Lambda lets you run Amazon Lambda functions locally. You can run them from the command line or integrate calls within a regular Node.js script, e.g. to use in unit testing or simply as part of a regular application.

Install

# For command line use
npm install -g local-node-lambda
# For Node.js use
npm install local-node-lambda

Usage

# Run from Node.js
var localNodeLambda = require('local-node-lambda');

localNodeLambda.invoke(<eventObj>, <path>, <handler>, <timeout>, function (err, message) {
	if (err) {
		console.log(err);
	} else {
		console.log(message);
	}
	process.exit();
});
# Run from command line
local-node-lambda

Command Line Help

Parameters

Event data

From the regular node execution you can pass in a JSON object as the event object, while from the command line you can pass in a js file that exports a JSON object.

# Command line sample event
module.exports = {
	hello: "world"
};

Inspiration

License

This library is released under the MIT license.