1.1.7 • Published 7 years ago

@avidjs/compose v1.1.7

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

@avidjs/compose

npm Node.js Build Status Coverage Dependencies Status devDependencies Status MIT licensed

Composes an array of middleware functions into a call-able middleware stack.

Essentially, a fork of koa-compose that features more exhaustive commenting and doesn't perform type checking for every element in the array argument.

Part of Avid, an attempt to better understand Koa and Express by taking them apart.

Installation

npm install --save @avidjs/compose

Usage

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


let fn = compose([
  async (ctx, next) => {
    console.log('first');
    await next();
    console.log('sixth');
  },
  async (ctx, next) => {
    console.log('second');
    await next();
    console.log('fifth');
  },
  async (ctx, next) => {
    console.log('third');
    await next();
    console.log('fourth');
  }
]);


fn({});
1.1.7

7 years ago

1.1.6

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.0.0

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago

0.0.0

7 years ago