This package provides minimal implementation for promise based asynchronous middleware pattern with complete typings.
Using npm:
$ npm i async-middleware-ts
const mw = new MiddlewareStack<your-request-type, your-response-type>()
mw.use((request, handler) => {
handler(request)
})
const result = await mw.go(your-request, async () => {
// your-async-app-function
return 'result'
})