wrapping-middleware

skeleton middleware for performing some action at the start and end of handling a request

Usage no npm install needed!

<script type="module">
  import wrappingMiddleware from 'https://cdn.skypack.dev/wrapping-middleware';
</script>

README

Description

Skeleton middleware for creation of middleware which perform some processing at the start and end of a request. Behaviour is customised by providing start and end functions which are executed at the respective points. Removes a small piece of friction when making middlewares such as active request counters which might increment a counter in start, and decrement it in end.