Giter Site home page Giter Site logo

Comments (9)

aredridel avatar aredridel commented on April 20, 2024

Love this move.

from compression.

dougwilson avatar dougwilson commented on April 20, 2024

So just if you were wondering, @aredridel , the idea is to provide a through stream-like interface as well as a buffered-up interface, not only for use in this library, but for use to do things like re-write links in HTML responses. It would also take care of altering the headers like Content-Length for you so they are actually correct.

from compression.

aredridel avatar aredridel commented on April 20, 2024

That sounds like my use cases! Security hacks, link rewrites, compression, verification trailers, all kinds of uses.

from compression.

dougwilson avatar dougwilson commented on April 20, 2024

All very important uses indeed. The main reason this alters a res is for compatibility with the middleware pattern as well as avoiding the complications of needing to re-implement core functionality or needing to jump through hoops to delegate correctly. This stuff that is coming is extremely well tested and builds off the current Node.js core expertise :)

from compression.

tlivings avatar tlivings commented on April 20, 2024

Can't happen soon enough. Another use case: output validation. Any sort of tentative timeline?

from compression.

dougwilson avatar dougwilson commented on April 20, 2024

Any sort of tentative timeline?

Just time-dependent. It's also not easy to get right; there are so many edge cases. I also need it very much :)

from compression.

olalonde avatar olalonde commented on April 20, 2024

Any updates on this? I need this for a bandwidth monitoring middleware I'm working on. For now, I resorted to copy-pasting the code from here :/

from compression.

olalonde avatar olalonde commented on April 20, 2024

I've started working on something for my own middleware: expressjs/express#2811 (comment)

Would be nice to see if it works with this module. Eventually we could extract the patch(res) procedure to a standalone middleware that needs to be used before response transform stream middlewares like this one. e.g.:

import responseUse from 'response-use';
app.use(responseUse);
app.use(compression);

The compression module could add itself to the list of transform stream with res.use(compressionStream) instead of having to patch res.write/res.end.

Let me know your thoughts.

from compression.

olalonde avatar olalonde commented on April 20, 2024

Created a repo here: https://github.com/olalonde/express-transform

from compression.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.