-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use node-fetch-retry with @adobe/helix-fetch #75
Comments
Thinking this a bit further, it would be cool to have the ability to run the entire library in the browser, using |
@trieloff Why do you think that const { fetch, reset } = require('@adobe/helix-fetch');
fetch('http://example.com')
.then(async (resp) => console.log(`${resp.status} - ${await resp.text()}`))
.finally(reset); BTW: as of v3 |
If the |
Is browser support "just cool" or needed for your project? |
|
Not needed for helix-fetch in particular. But it might be useful to have this project support browsers as well, if possible (might need to be renamed to |
Closing in favor of #86. |
I'm working on a project with @alexkli and we would like to use @stefan-guggisberg's https://github.com/adobe/helix-fetch but also use this project's retry functionality.
This project has
node-fetch
hardcoded as a dependency, but as the dependency footprint is small, it should theoretically be possible to use a different fetch implementation.I've tried using npm 8.3's
override
functionality to make replacenode-fetch
transparently with@adobe/helix-fetch
, but ran into subtle incompatibilities:node-fetch
exportsfetch
as a default export, in@adobe/helix-fetch
it is{ fetch }
node-fetch
can berequire
d,@adobe/helix-fetch
needs to beimport
edI could imagine a pull request that would
node-fetch
into a peer dependencyoptions.fetch
parameter that allows passing afetch
implementationnode-fetch
as the default for this parameterrequire()
snode-fetch
dynamically (so that it is optional, but that might make packaging a bit more difficult)The text was updated successfully, but these errors were encountered: