1.0.0 • Published 2 years ago

pipou v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

pipou

Middleware builder

Usage

Configure the middleware chain by calling use().

Then, execute() the chain: this will always return Promise<void>

await new MiddlewareBuilder <{someValue: string}> ()
    .use(async (message, next) => {
        message.someValue = 'hi';
        await next();
    })
    .use((message, _) => {
        message.someValue = 'bonjour';
    })
    .execute({someValue: 'hello'});