alltherooms / cached-request

Node.js module to perform HTTP requests with caching support
MIT License
61 stars 23 forks source link

Support for promises #30

Open ComFreek opened 5 years ago

ComFreek commented 5 years ago

There's this request-promise-native package, which wraps around request to deliver a Promise interface. What would be the best approach delivre Promises with cached-request? Somehow, I see them both as mixins in a "class hiearchy", which could be mixed independently.

elhoyos commented 5 years ago

Hi @ComFreek, interesting, but does it mean we won't be able to stream from requests?

Sometimes streaming helps dealing with huge amounts of payloads. How can we do that with promises?

ComFreek commented 5 years ago

That's a good question! For my use case I just load a reasonably small JSON file from a server, so loading in-memory is an option.

Note that I switched to got in the meantime. Thanks for answering nonetheless. I let you decide whether to close this issue or not.