@ihacks.dev/middleware
v0.1.3
Published
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/481bcdd68a64467b9a6915b45f238323)](https://www.codacy.com/gl/ihacks.dev/middleware) [![pipeline status](https://gitlab.com/ihacks.dev/node/ts/module/middleware/badges/master/pipeline.svg)]
Downloads
4
Readme
@ihacks.dev/middleware
A queue builder for middlewares.
Installation
yarn add @ihacks.dev/middleware
# or
npm i -S @ihacks.dev/middleware
Usage
Create a queue object.
const queue = new Queue<[ string, number, boolean ]>();
Add middlewares.
queue.add(async (next, str, num, bool) => {
console.log(str, num, bool);
await next();
console.log("done");
})
Run the queue.
await queue.runMiddleware("a string", 123, true);
License
See LICENSE.