Socket
Socket
Sign inDemoInstall

lambda-piper

Package Overview
Dependencies
5
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    lambda-piper

Pipe-And-Filter using lambda functions


Version published
Maintainers
1
Created

Readme

Source

Lambda Piper

Pipe-And-Filter using lambda functions


A very simple, yet powerful architecture, that is also very robust. It consists of any number of components (filters) that transform or filter data, before passing it on via connectors (pipes) to other components. The filters are all working at the same time. The architecture is often used as a simple sequence, but it may also be used for very complex structures.

Use the Pipes and Filters architectural style to divide a larger processing task into a sequence of smaller, independent processing steps (Filters) that are connected by channels (Pipes).

Lambda Piper allows you to create a linear pipeline using AWS Lambda functions. You can pipe several Lambda function with an initial input. Lambda piper will invoke the first function with the initial input, then get the result of that function and feed it as the input to next function and this pipeline continues, finally returning the results of the last function.

Pipeline

Install

npm install lambda-piper

Usage

var lambdaPiper = require('lambda-piper');

var piper = new lambdaPiper({
    region: 'aws region',
    accessKeyId: 'your key',
    secretAccessKey: 'your secret',
    options: {
        debug: false
    }
});

If debug is set to true, result of every lambda function will be logged to console.

Pipe function

piper.pipe(<Array of function names>, <Initital input>, <Callback>);

Example:

piper.pipe(['test1', 'test2'], {
    key3: 1
}, function (err, data) {
    console.log(err || data);
});

First function test1 will be executed with the initial input, the output of that function is passed as input to the next function test2 and finally the callback is called.

NOTE. If any of the function throws error, the pipeline execution will be stopped immediately.

About Author

Built with <3 by Arjun Komath / arjunkomath@gmail.com

License

See the LICENSE file for license rights and limitations (MIT).

Keywords

FAQs

Last updated on 29 May 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc