Skip to content

Commit

Permalink
doc: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
franck-romano committed Aug 19, 2022
1 parent 2142234 commit a8ebbff
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,21 @@
# pipou

Middleware builder

## Usage

Configure the middleware chain by calling `use()`.

Then, `execute()` the chain: this will always return `Promise<void>`
```js
await new MiddlewareBuilder <{someValue: string}> ()
.use(async (message, next) => {
message.someValue = 'hi';
await next();
})
.use((message, _) => {
message.someValue = 'bonjour';
})
.execute({someValue: 'hello'});
```

0 comments on commit a8ebbff

Please sign in to comment.