Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

chaining-tool

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chaining-tool

Chain of responsibility

latest
Source
npmnpm
Version
0.0.4
Version published
Maintainers
1
Created
Source

Chaining tool

Fast way to create chain of responsibility

##Install

npm install chaining-tool

##Usage

var Chain = require('chaining-tool');

var chain = new Chain();

chain.add(function(context, next){
    //Do somethong with context
    next(); //Next handler
});

chain.add(function(context, next){
    //Do somethong with context
    next(false); //Interrupt
});

var context = {"some" : "data"};

chain.start(context, 
    function(context) {
        //success
    }, 
    function(context) {
    //interrupted
    }
);

FAQs

Package last updated on 10 Apr 2015

Did you know?

Socket

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