Socket
Socket
Sign inDemoInstall

bamba

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    bamba

easily combine functions together


Version published
Maintainers
1
Install size
3.76 kB
Created

Readme

Source

middle

uses syntax similar to express middlewares, but outside the context of webapps

Installation

npm i -S sturdy-octo-broccoli

Usage Example

var middle = require('sturdy-octo-broccoli')

middle(function (context, next) {
  // do something with context

  next(); // call next when you're done.
}, function (context, next) {
  // modifications on context are available in the next function

  if ( context.error ){
     next('got an error'); // pass error. this will reach the next function with error
  } else {
    next(); // simply moves to next function
  }
}, function( context, next ){
    // if the previous function passed an error, we will skip this one
    next();
},function (err, context, next) {
    // this function will be invoked if there was an error, and if there was no error
    // it allows you to handle the error and move on
}, ... )


FAQs

Last updated on 09 Jul 2018

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