Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

Use builtin fetch for Node if exists #60

Closed
wants to merge 2 commits into from
Closed

Use builtin fetch for Node if exists #60

wants to merge 2 commits into from

Conversation

flakey5
Copy link

@flakey5 flakey5 commented Apr 14, 2024

The current behavior of this client replaces the globalThis.fetch with node-fetch if it's not in a browser regardless of if a global fetch implementation already exists. However, Node (since v18), Deno, and Bun all have builtin implementations of the fetch api.

This pr makes it so that,

  • the client uses the builtin fetch api whenever possible
  • if it needs to use node-fetch, it doesn't set it as the global implementation

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants