Express and middleware that manipulate reponses
Open
discuss
enhancement
ideas
- Dominant language
- JavaScript
- Stars
- 69.5k
- Forks
- 25k
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 9
Description
AFAIK, there is currently no generic / documented way to manipulate responses before they are passed on to the underlying socket (through a transform stream for example). I can think of 2 instances where this would be useful: compression and monitoring outgoing bandwidth.
The https://github.com/expressjs/compression/ module resorts to monkey patching the `res` object which is prone to error, difficult to maintain and not extensible.
It would be nice if there was a documented and extensible way to manipulate responses before they are passed to the underlying socket.
Contributor guide
Assessment
This issue has not been assessed yet.