npm/make-fetch-happen ? reverse-engineered prompt
Reverse engineered prompt
Build me a Node.js fetch helper that feels like the built in fetch, but is much more useful for real world app and CLI work.
I want it to make HTTP requests with caching, so repeated calls can come from disk and work offline when possible. It should also handle retries for flaky requests, support proxies, keep connections pooled for performance, and let me set things like SSL certs, DNS caching, and request timeouts. It should work with normal response methods like json and buffer, and support streams too.
Please make it easy to create a fetch instance with default settings, so I can point it at a cache folder and reuse the same config across my app. Keep the API simple and close to standard fetch, but add the extra network features in a clean way. If you need to check current docs for the underlying fetch behavior or HTTP caching rules, go ahead and look them up online.
Are you gonna build this?
make sure you review the code using coderabbit