Skip to content

Express and middleware that manipulate reponses #2811

Open
@olalonde

Description

@olalonde

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions