Skip to content

Latest commit

 

History

History
63 lines (48 loc) · 1.78 KB

readme.md

File metadata and controls

63 lines (48 loc) · 1.78 KB

@fibjs/compose

NPM version build status appveyor build status Test coverage David deps Known Vulnerabilities npm download

Compose middleware.

Install

$ npm i @fibjs/compose --save

Usage

const compose = require('@fibjs/compose');

const middleware = [
  (ctx, next) => {
    next();
  },
  (ctx, next) => {
    next();
  },
];

const fn = compose(middleware);
const ctx = {
  num: 1,
};

fn(ctx)(ctx, (ctx) => {});

Questions & Suggestions

Please open an issue here.

License

MIT