middlewerewolf
Lightweight ES6 async/await middleware library
Installation
yarn add middlewerewolf
Usage
;let app = ; // This middleware will execute without issueapp; // This middleware will execute, but does not call next()app; // This middleware will not execute, as the previous middleware// did not call next()app; // Register multiple middleware with a single commandappall async { ctxfoo = true; await ; } async { ctxbar = true; await ; }; // Compose a new middleware execution chainlet fn = app; // Execute the chain;
Build middlewerewolf
git clone git@github.com:aewing/middlewerewolf.git
cd middlewerewolf/
make lint
make flow
make test
make build
Contributing
Pull requests are welcome, but I intend to keep this package as lightweight and future compliant as possible.
Credits
Much love to koa-compose, which inspired this package.