2.1.0 • Published 9 years ago

serial-middleware v2.1.0

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

Usage

  var serial = require('serial-middleware');

  router.use(serial(
    function (req, res, next) {
      // append new value
      next(null, 'foo');
    },
    function (req, res, next, foo) {
      // foo is 'foo'
      // more than one supported
      next(null, 'bar', 'baz');
    },
    function (req, res, next, bar, baz) {
      // short circuit
      next(new Error());
    },
    function (req, res, next) {
      // will not be called due to the Error passed to next
    }
  ));