Skip to content

Replace fetchpolyfills with native fetch / undici #145

@v1rtl

Description

@v1rtl

fetch is available since node v18

Things to take into consideration

  • node.js fetch only supports proxies through env vars
  • node.js fetch doesn't support passing a custom http.Agent

for folks who need http agent or proxy support, node-fetch-native is available.

Total list of fetch polyfill packages

  • node-fetch
  • cross-fetch
  • @web-std/fetch
  • unfetch
  • isomorphic-unfetch
  • @whatwg-node/fetch
  • node-fetch-commonjs
  • whatwg-fetch
  • isomorphic-fetch
  • fetch-ponyfill
  • @remix-run/web-fetch
bunx github:Fuzzyma/e18e-tools node-fetch -n 150 -U https://npm.devminer.xyz/registry -q -o md
# Downloads Traffic Version Package PR Minimum Node version
1 99.64M 3160.78 GB ^3.3.2 gaxios
2 86.90M 2756.68 GB ^2.7.0 cross-fetch
3 43.35M 1375.05 GB ^3.3.2 teeny-request
4 40.08M 1271.48 GB ^3.3.2 google-gax
5 34.52M 1094.90 GB ^2.6.7 @mapbox/node-pre-gyp
6 31.08M 985.91 GB ^2.6.7 @sentry/cli
7 23.95M 759.77 GB ^2.6.1 isomorphic-fetch
8 13.27M 421.02 GB ^2.6.1 @nuxtjs/opencollective
9 9.27M 293.99 GB ^2.6.1 swagger2openapi
10 9.24M 293.00 GB ^3.3.2 sync-fetch
11 9.10M 288.54 GB ^2.6.1 @ardatan/sync-fetch
12 8.88M 281.82 GB ^3.2.0 isomorphic-unfetch
13 5.93M 188.24 GB ^2.6.7 apollo-server-env
14 5.29M 167.87 GB 2.7.0 @module-federation/node
15 5.23M 165.96 GB ^2.7.0 @stoplight/spectral-runtime
16 5.23M 165.82 GB ^2.6.0 @stoplight/json-ref-readers
17 4.94M 156.72 GB ^2.6.7 @azure/core-http
18 4.87M 154.35 GB 2.6.9 @vercel/node
19 4.74M 150.50 GB ^2.6.11 @serverless/utils
20 4.42M 140.15 GB ^2.7.0 @solana/web3.js
21 4.34M 137.52 GB ^3.3.2 edgedriver
22 3.87M 122.68 GB ^2.7.0 @kubernetes/client-node
23 3.76M 119.28 GB 2.6.7 @vercel/fun
24 3.73M 118.47 GB ^2.6.8 @serverless/dashboard-plugin
25 3.72M 118.06 GB ^2.6.1 @expo/rudder-sdk-node
26 3.65M 115.67 GB ^2.6.7 @azure/ms-rest-js
27 3.63M 115.04 GB ^2.6.7 @segment/analytics-node
28 3.52M 111.61 GB ^2.6.7 @microsoft/signalr
29 3.40M 107.76 GB ^2.6.7 @segment/analytics-next
30 3.27M 103.70 GB ^2.6.7 npm-registry-utilities
31 3.00M 95.31 GB ^2.6.7 firebase-tools
32 2.99M 94.74 GB 3.3.2 netlify
33 2.98M 94.60 GB ^2.6.1 jsforce
34 2.96M 93.93 GB ^2.6.7 @storybook/manager-webpack4
35 2.96M 93.76 GB ^2.6.7 @vue/cli-shared-utils
36 2.45M 77.84 GB ^2.6.7 danger
37 2.31M 73.28 GB ^3.3.2 serverless-offline
38 2.26M 71.57 GB ^2.6.7 @browserbasehq/sdk
39 2.21M 70.08 GB ^2.6.0 @hubspot/api-client
40 2.06M 65.39 GB ^2.6.7 cloudflare
41 2.03M 64.33 GB ^2.2.0 metro-inspector-proxy
42 1.91M 60.60 GB ^2.6.7 @storybook/manager-webpack5
43 1.89M 59.81 GB 2.6.7 @asyncapi/parser
44 1.87M 59.24 GB ^2.5.0 @changesets/get-github-info
45 1.85M 58.63 GB ~2.6.1 @tensorflow/tfjs-core
46 1.78M 56.34 GB ^2.6.1 @lerna/gitlab-client
47 1.75M 55.67 GB ^2.6.1 @jsforce/jsforce-node
48 1.72M 54.52 GB 2.6.7 @applitools/core
49 1.70M 54.02 GB 3.3.1 @applitools/req
50 1.59M 50.58 GB ^2.6.7 groq-sdk
51 1.59M 50.41 GB npm:@pnpm/node-f @pnpm/fetching-types
52 1.59M 50.40 GB ^3.3.2 @libsql/hrana-client
53 1.59M 50.40 GB ^2.6.1 svix-fetch
54 1.50M 47.46 GB ^3.3.2 supabase
55 1.38M 43.67 GB ^3.3.2 shadcn
56 1.37M 43.55 GB ^2.6.7 @applitools/execution-grid-tunnel
57 1.36M 43.03 GB ^2.6.9 tesseract.js
58 1.30M 41.29 GB ^2.6.11 gatsby-cli
59 1.30M 41.24 GB ^2.6.11 gatsby
60 1.29M 41.07 GB ^2.7.0 cohere-ai
61 1.21M 38.37 GB ^2.6.1 pusher
62 1.19M 37.72 GB 2.6.8 verdaccio-audit
63 1.17M 37.24 GB ^2.6.1 apollo-env
64 1.16M 36.75 GB 2.6.7 eas-cli
65 1.15M 36.58 GB ^2.6.7 @apollo/gateway
66 1.13M 35.88 GB ^2.6.0 npm-api
67 1.10M 34.97 GB ^2.7.0 statsig-node
68 1.07M 33.87 GB ^2.7.0 @splitsoftware/splitio
69 1.05M 33.23 GB 2.7.0 checkpoint-client
70 1.03M 32.73 GB ~2.6.1 fetch-ponyfill
71 1.03M 32.52 GB ^2.6.0 image-to-base64
72 1.00M 31.79 GB ^2.6.6 pkg-fetch
73 990.38k 31.42 GB ^2.6.7 airtable
74 977.58k 31.01 GB ^2.6.0 expo-server-sdk
75 975.08k 30.93 GB ~2.6.1 @tensorflow/tfjs-data
76 940.02k 29.82 GB npm:@pnpm/node-f @pnpm/fetch
77 888.48k 28.18 GB ^3.3.2 @genkit-ai/ai
78 874.34k 27.74 GB ^2.6.7 @electron-forge/core
79 826.15k 26.21 GB 2.7.0 @microsoft/teams-manifest
80 812.08k 25.76 GB ^2.6.7 @eth-optimism/core-utils
81 808.73k 25.65 GB ^2.7.0 @backstage/backend-defaults
82 796.87k 25.28 GB ^2.7.0 intercom-client
83 785.85k 24.93 GB ^3.3.2 ky-universal
84 774.16k 24.56 GB ^2.6.1 office-addin-manifest
85 772.53k 24.51 GB ^2.6.1 auto-changelog
86 769.26k 24.40 GB 3.3.2 netlify-cli
87 712.66k 22.61 GB ^3.3.1 gh-release-fetch
88 710.34k 22.53 GB ^2.7.0 pubnub
89 700.78k 22.23 GB ^3.3.2 @genkit-ai/googleai
90 694.80k 22.04 GB ^2.6.0 @expo/dev-server
91 690.60k 21.91 GB ^2.6.7 @okta/okta-sdk-nodejs
92 680.13k 21.58 GB ^2.6.12 @databricks/sql
93 621.92k 19.73 GB ^2.6.1 serverless-plugin-datadog
94 613.74k 19.47 GB ^2.6.7 @metaplex-foundation/umi-http-fetch
95 601.54k 19.08 GB ^2.6.7 @angular-architects/module-federation
96 599.12k 19.01 GB 2.7.0 cdktf-cli
97 596.72k 18.93 GB 2.7.0 @cdktf/cli-core
98 587.78k 18.65 GB ^3.3.2 @genkit-ai/google-cloud
99 587.55k 18.64 GB 2.6.7 @lerna/legacy-package-management
100 576.24k 18.28 GB 2.6.7 near-api-js
101 561.29k 17.81 GB ^2.6.7 cross-undici-fetch
102 544.96k 17.29 GB 3.3.2 @chakra-ui/cli
103 544.47k 17.27 GB ^3.3.2 @polkadot/x-fetch
104 535.26k 16.98 GB ^1.7.3 slackup
105 533.36k 16.92 GB ^2.7.0 @backstage/backend-common
106 531.82k 16.87 GB 2.7.0 @capacitor/assets
107 523.21k 16.60 GB ^3.3.2 nylas
108 508.55k 16.13 GB ^2.7.0 telegraf
109 480.20k 15.23 GB ^2.6.7 @apollo/datasource-rest
110 476.75k 15.12 GB ^2.6.7 avatax
111 471.91k 14.97 GB ^2.6.7 @mux/mux-node
112 467.95k 14.84 GB ^2.7.0 botframework-connector
113 463.24k 14.69 GB 2 notion-to-md
114 443.44k 14.07 GB ^2.6.0 ember-source-channel-url
115 443.24k 14.06 GB ^3.3.2 chaingate
116 436.37k 13.84 GB ^2.6.12 @liquiditeam/sdk
117 432.85k 13.73 GB 2.7.0 @getzep/zep-js
118 430.84k 13.67 GB ~2.7.0 pa11y-ci
119 430.25k 13.65 GB ^2.6.1 office-addin-cli
120 420.82k 13.35 GB ^2.6.0 bitbucket
121 406.67k 12.90 GB 3.3.2 @shopify/cli-kit
122 393.93k 12.50 GB ^2.6.1 passport-twitch-strategy
123 387.03k 12.28 GB ^2.2.0 get-graphql-schema
124 373.82k 11.86 GB ^3.3.2 @modelcontextprotocol/inspector
125 370.98k 11.77 GB 2.7.0 @crowdin/cli
126 367.55k 11.66 GB ^2.6.6 @yao-pkg/pkg-fetch
127 365.07k 11.58 GB 2.7.0 @microsoft/teamsfx-core
128 363.48k 11.53 GB ^2.6.5 @stoplight/prism-http
129 360.57k 11.44 GB 1.6.3 opencollective
130 356.82k 11.32 GB ^3.3.0 @shadcn/ui
131 350.41k 11.12 GB ^2.3.0 @builder.io/sdk
132 349.83k 11.10 GB ^2.6.5 @stoplight/prism-cli
133 345.57k 10.96 GB ^2.6.0 @serverless/component-metrics
134 337.34k 10.70 GB ^2.6.0 @asyncapi/generator
135 337.03k 10.69 GB 2.7.0 @usebruno/js
136 336.74k 10.68 GB ^2.6.5 @stoplight/prism-http-server
137 336.30k 10.67 GB ^2.6.7 statsig-node-lite
138 333.54k 10.58 GB 2.6.7 @auto-it/core
139 331.44k 10.51 GB ^2.6.0 datadog-winston
140 327.53k 10.39 GB ^2.6.7 inngest-cli
141 319.55k 10.14 GB ^3.3.2 @aws-amplify/form-generator
142 317.31k 10.07 GB ^2.6.0 @nextnextools/xrom
143 313.99k 9.96 GB ^2.6.1 office-addin-debugging
144 313.58k 9.95 GB ^2.6.1 office-addin-node-debugger
145 311.25k 9.87 GB ^2.7.0 @mergeapi/merge-node-client
146 308.24k 9.78 GB 2.7.0 @statsig/statsig-node-core
147 305.85k 9.70 GB ^2.7.0 elevenlabs
148 302.63k 9.60 GB ^2.6.7 eth-json-rpc-middleware
149 299.92k 9.51 GB ^2.6.0 node-geocoder
150 298.66k 9.47 GB ^2.6.8 ipfs-utils

cross-fetch:

# Downloads Traffic Version Package PR
1 40.75M 900.70 GB ^3.1.5 fbjs
2 6.82M 150.83 GB ^3.0.4 jest-fetch-mock
3 6.34M 140.21 GB 4.0.0 i18next-http-backend
4 4.36M 96.40 GB ^4.0.0 web3-providers-http
5 3.47M 76.64 GB ^3.1.5 @datadog/datadog-api-client
6 2.78M 61.52 GB ^3.1.5 @okta/okta-auth-js
7 1.24M 27.49 GB ^3.1.4 @walletconnect/jsonrpc-http-connection WalletConnect/walletconnect-utils#217
8 1.52M 33.67 GB ^3.1.5 @coral-xyz/anchor
9 1.21M 26.66 GB ^4.0.0 @metamask/sdk
10 1.03M 22.81 GB ^3.0.2 @cubejs-client/core
11 1.01M 22.33 GB ^3.1.5 wiremock-rest-client
12 1.00M 22.17 GB ^4.1.0 @cosmjs/tendermint-rpc
13 918.31k 20.30 GB ^4.0.0 @backstage/plugin-permission-common
14 896.19k 19.81 GB ^3.1.5 mockttp
15 824.37k 18.22 GB ^4.0.0 @libsql/hrana-client
16 814.50k 18.00 GB ^4.0.0 quicktype-core
17 771.49k 17.05 GB 4.1.0 alasql
18 770.18k 17.02 GB ^3.0.6 @pagerduty/pdjs
19 721.27k 15.94 GB ^4.0.0 inngest
20 704.41k 15.57 GB ^4.1.0 @smithery/cli

@web-std/fetch:

# Downloads Traffic Version Package
1 32.85k 2.19 GB ^4.2.1 @modern-js/server-core
2 26.74k 1.78 GB ^4.1.2 nft.storage
3 15.28k 1.02 GB ^4.1.0 w3name
4 11.46k 763.40 MB ^4.1.2 web3.storage
5 6.63k 441.66 MB ^3.0.3 @filebase/client

unfetch:

# Downloads Traffic Version Package
1 9.76M 85.54 GB ^5.0.0 isomorphic-unfetch
2 2.89M 25.35 GB ^3.1.1 @segment/analytics.js-video-plugins
3 2.88M 25.20 GB ^4.1.0 @segment/analytics-next
4 1.36M 11.95 GB ^4.2.0 @splitsoftware/splitio
5 947.07k 8.30 GB ^4.2.0 idtoken-verifier
6 818.33k 7.17 GB 4.1.0 @amplitude/experiment-js-client
7 817.65k 7.17 GB ^5.0.0 @nuxt/vue-app
8 119.13k 1.04 GB 4.2.0 @redocly/openapi-docs
9 118.89k 1.04 GB ^4.2.0 @splitsoftware/splitio-browserjs
10 116.89k 1.02 GB ^4.2.0 @plasmicapp/isomorphic-unfetch

isomorphic-unfetch

# Downloads Traffic Version Package
1 3.94M 5.81 GB ^3.0.0 amazon-cognito-identity-js
2 1.11M 1.64 GB ^3.1.0 @linear/sdk
3 303.28k 446.73 MB 4.0.2 @umijs/test
4 123.57k 182.02 MB ^4.0.0 mailersend
5 78.92k 116.24 MB ^3.1.0 @walletconnect/auth-client

@whatwg-node/fetch:

# Downloads Traffic Version Package
1 17.99M 214.29 GB ^0.10.0 @graphql-tools/url-loader
2 15.82M 188.45 GB ^0.10.8 @graphql-tools/executor-http
3 14.13M 168.32 GB ^0.10.0 @graphql-codegen/cli
4 13.89M 165.47 GB ^0.10.0 @graphql-tools/github-loader
5 13.75M 163.70 GB ^0.10.0 @graphql-tools/apollo-engine-loader
6 13.10M 155.98 GB ^0.10.0 @graphql-tools/prisma-loader
7 3.66M 43.64 GB ^0.10.8 @whatwg-node/server
8 2.24M 26.64 GB ^0.10.6 graphql-yoga
9 502.87k 5.99 GB ^0.10.6 @graphql-mesh/utils
10 380.31k 4.53 GB ^0.10.6 @graphql-hive/core

node-fetch-commonjs

# Downloads Traffic Version Package
1 2.73M 173.64 GB ^3.3.2 swagger-client

whatwg-fetch

not a node polyfill but still should not be used, see #145 (comment)

# Downloads Traffic Version Package
1 23.47M 316.09 GB ^3.4.1 isomorphic-fetch
2 16.42M 221.05 GB ^3.6.2 react-app-polyfill
3 13.64M 183.72 GB ^3.0.0 react-native
4 2.86M 38.53 GB ^3.6.2 @vue/cli-service
5 1.40M 18.85 GB 2.0.4 @firebase/polyfill
6 1.17M 15.69 GB ^3.4.1 svix-fetch
7 1.07M 14.35 GB ^3.6.20 ollama
8 744.18k 10.02 GB ^3.6.19 storybook-addon-mock
9 357.77k 4.82 GB ^3.0.0 react-native-windows
10 324.72k 4.37 GB ^3.6.2 ember-fetch

isomorphic-fetch

# Downloads Traffic Version Package
1 2.86M 9.37 GB ^3.0.0 update-notifier-cjs
2 1.21M 3.97 GB ^3.0.0 @lhci/utils
3 1.18M 3.87 GB ^3.0.0 @lhci/cli
4 630.70k 2.07 GB ^3 openapi-merge-cli
5 344.00k 1.13 GB ^3.0.0 @open-rpc/schema-utils-js
6 279.13k 914.45 MB ^3.0.0 api
7 259.75k 850.92 MB ^3.0.0 @open-rpc/client-js
8 247.87k 812.03 MB 3.0.0 oci-common
9 236.07k 773.35 MB ^3.0.0 testcafe-reporter-dashboard
10 198.09k 648.94 MB ^3.0.0 @xstate/cli

fetch-ponyfill

# Downloads Traffic Version Package
1 181.09k 1.54 GB ^7.1.0 @citation-js/core
2 173.07k 1.47 GB ^7.1.0 formiojs
3 92.38k 783.52 MB ^7.1.0 @rockset/client
4 72.47k 614.68 MB ^7.1.0 @formio/core
5 21.99k 186.55 MB ^4.0.0 embed-video

@remix-run/web-fetch

# Downloads Traffic Version Package
1 3.02M 200.18 GB ^4.4.2 @remix-run/node
2 45.88k 3.05 GB ^4.4.2 create-react-router
3 13.86k 920.43 MB ^4.4.2 @remix-run/architect

Metadata

Metadata

Assignees

No one assigned

    Labels

    umbrella issueThis issue contains a list of dependents of a package and tracks the progress in each

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions