Beware
Lightweight async/await middleware library (formerly middlewerewolf)
Installation
yarn add beware
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 beware
git clone git@github.com:aewing/beware.git
cd beware/
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.