serial-middleware

2.1.0 • Public • Published

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
    }
  ));

Package Sidebar

Install

npm i serial-middleware

Weekly Downloads

0

Version

2.1.0

License

MIT

Last publish

Collaborators

  • dmoscrop