Skip to content

Replace fetchpolyfills with native fetch / undiciΒ #145

@talentlessguy

Description

@talentlessguy

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 83.23M 2640.31 GB ^2.7.0 cross-fetch
2 67.86M 2152.76 GB ^3.3.2 gaxios
3 60.29M 1912.61 GB ^2.7.0 ua-parser-js faisalman/ua-parser-js#799
4 38.64M 1225.62 GB ^3.3.2 teeny-request deprecated
5 33.12M 1050.70 GB ^2.6.7 @mapbox/node-pre-gyp
6 29.39M 932.34 GB ^2.7.0 google-gax
7 23.47M 744.61 GB ^2.6.1 isomorphic-fetch
8 22.69M 719.90 GB ^2.6.7 @sentry/cli
9 14.40M 456.70 GB ^2.6.1 @nuxtjs/opencollective
10 11.27M 357.65 GB 2.7.0 @neoxr/wb
11 9.76M 309.54 GB ^3.2.0 isomorphic-unfetch
12 9.66M 306.45 GB ^2.6.1 @ardatan/sync-fetch
13 8.86M 281.04 GB ^2.6.1 swagger2openapi
14 8.17M 259.29 GB ^3.3.2 sync-fetch
15 8.14M 258.33 GB 2.6.7 lerna
16 8.06M 255.63 GB 2.6.7 @lerna/create
17 6.01M 190.77 GB ^2.6.7 @azure/core-http
18 5.71M 181.22 GB ^2.6.7 apollo-server-env
19 5.43M 172.32 GB ^2.6.7 @apollo/server
20 4.85M 153.71 GB ^2.6.7 @storybook/manager-webpack4
21 4.80M 152.39 GB ^2.6.11 @serverless/utils
22 4.66M 147.68 GB ^3.3.2 geckodriver
23 4.17M 132.19 GB ^2.6.1 @expo/rudder-sdk-node
24 4.15M 131.67 GB ^2.6.0 @stoplight/json-ref-readers
25 4.07M 129.22 GB ^2.7.0 @solana/web3.js Deprecated
26 3.77M 119.48 GB 2.6.9 @vercel/node
27 3.72M 118.05 GB ^2.7.0 @stoplight/spectral-runtime
28 3.62M 114.97 GB ^3.3.2 edgedriver
29 3.59M 113.87 GB ^2.6.8 @serverless/dashboard-plugin
30 3.57M 113.37 GB 2.7.0 @module-federation/node
31 3.56M 112.91 GB ^2.6.7 @vue/cli-shared-utils
32 3.51M 111.28 GB ^2.6.9 @kubernetes/client-node
33 3.20M 101.56 GB ^2.6.7 npm-registry-utilities
34 3.17M 100.44 GB ^2.6.1 @lerna/gitlab-client
35 3.15M 100.05 GB 2.6.7 @vercel/fun
36 3.13M 99.15 GB ^2.6.7 @segment/analytics-node
37 3.05M 96.81 GB ^2.6.7 @microsoft/signalr
38 3.02M 95.93 GB ^2.6.7 @azure/ms-rest-js
39 2.88M 91.20 GB ^2.6.7 @segment/analytics-next
40 2.86M 90.80 GB ^2.6.7 @storybook/manager-webpack5
41 2.74M 86.94 GB ^2.6.1 jsforce
42 2.74M 86.77 GB ^2.6.7 firebase-tools
43 2.70M 85.54 GB ^2.2.0 metro-inspector-proxy
44 2.59M 82.30 GB ^2.6.7 danger
45 2.22M 70.30 GB ^3.3.2 serverless-offline
46 2.19M 69.36 GB 3.3.2 netlify
47 2.05M 65.16 GB ^2.6.0 @hubspot/api-client
48 1.98M 62.81 GB ^2.5.0 @changesets/get-github-info
49 1.75M 55.57 GB 2.6.7 @applitools/core
50 1.62M 51.26 GB 2.6.7 @asyncapi/parser
51 1.55M 49.10 GB ~2.6.1 fetch-ponyfill
52 1.51M 47.76 GB ~2.6.1 @tensorflow/tfjs-core
53 1.50M 47.62 GB 3.3.1 @applitools/req
54 1.36M 43.26 GB ^2.7.0 @splitsoftware/splitio
55 1.36M 43.22 GB ^2.6.7 @browserbasehq/sdk
56 1.35M 42.88 GB ^2.6.0 npm-api
57 1.35M 42.69 GB 2.6.8 verdaccio-audit
58 1.34M 42.43 GB ^2.6.1 @jsforce/jsforce-node
59 1.28M 40.68 GB ^2.6.11 gatsby-cli
60 1.25M 39.55 GB 2.7.0 cohere-ai
61 1.24M 39.28 GB ^2.6.11 gatsby
62 1.19M 37.83 GB ^2.6.1 apollo-env
63 1.17M 36.97 GB ^2.6.1 svix-fetch
64 1.15M 36.32 GB ^2.6.13 statsig-node
65 1.13M 35.95 GB ^3.3.2 ky-universal
66 1.13M 35.90 GB ^3.3.2 supabase
67 1.08M 34.36 GB ^2.6.7 cloudflare
68 1.07M 34.09 GB 2.7.0 @microsoft/teams-manifest
69 1.05M 33.34 GB npm:@pnpm/node-f @pnpm/fetching-types
70 1.04M 32.89 GB ^2.6.7 @apollo/gateway
71 1.04M 32.84 GB ^2.6.7 @metaplex-foundation/umi-http-fetch
72 1.03M 32.55 GB ^2.6.1 pusher
73 1.01M 31.93 GB ^2.6.7 groq-sdk
74 984.59k 31.23 GB ^3.3.2 vega-loader
75 978.78k 31.05 GB ^2.6.7 @applitools/execution-grid-tunnel
76 970.13k 30.77 GB ^2.6.6 pkg-fetch
77 965.77k 30.64 GB 2.7.0 checkpoint-client
78 945.40k 29.99 GB ^2.6.7 eth-json-rpc-middleware
79 940.03k 29.82 GB ^2.6.7 @ethereum-waffle/compiler
80 925.66k 29.36 GB 2.6.7 eas-cli
81 913.25k 28.97 GB ^2.6.7 @eth-optimism/core-utils
82 869.42k 27.58 GB ^2.6.7 airtable
83 858.51k 27.23 GB ^2.6.9 tesseract.js
84 855.90k 27.15 GB ^2.6.0 ember-source-channel-url
85 845.41k 26.82 GB ^2.6.0 eth-json-rpc-infura
86 834.88k 26.48 GB ^2.6.0 @expo/dev-server
87 815.25k 25.86 GB ^3.3.0 shadcn
88 798.92k 25.34 GB 3.3.2 netlify-cli
89 796.62k 25.27 GB ^2.7.0 pubnub
90 785.75k 24.93 GB ^2.6.1 auto-changelog
91 768.73k 24.39 GB ^2.6.7 cross-undici-fetch
92 762.88k 24.20 GB ^2.6.12 @databricks/sql
93 754.98k 23.95 GB ^2.6.0 expo-server-sdk
94 739.63k 23.46 GB ^3.3.2 @libsql/hrana-client
95 738.87k 23.44 GB npm:@pnpm/node-f @pnpm/fetch
96 729.63k 23.15 GB ^2.6.1 office-addin-manifest
97 715.60k 22.70 GB 2.6.7 @lerna/legacy-package-management
98 708.89k 22.49 GB ^2.6.7 @electron-forge/core
99 702.12k 22.27 GB ^3.3.1 gh-release-fetch
100 701.97k 22.27 GB ^2.7.0 intercom-client
101 684.57k 21.72 GB ^2.6.0 image-to-base64
102 671.27k 21.29 GB ^2.7.0 @backstage/backend-common
103 663.83k 21.06 GB ^2.7.0 @backstage/backend-defaults
104 659.98k 20.94 GB ^3.3.2 @polkadot/x-fetch
105 619.56k 19.65 GB ~2.6.1 @tensorflow/tfjs-data
106 577.78k 18.33 GB ^2.6.7 @angular-architects/module-federation
107 551.98k 17.51 GB 2.7.0 cdktf-cli
108 515.21k 16.34 GB ^2.6.1 @shopify/shopify-api
109 510.35k 16.19 GB ^2.6.7 @okta/okta-sdk-nodejs
110 502.97k 15.96 GB ^2.6.8 ipfs-utils
111 497.69k 15.79 GB ^2.6.1 serverless-plugin-datadog
112 495.52k 15.72 GB ^2.6.12 nylas
113 494.87k 15.70 GB 2.7.0 @cdktf/cli-core
114 491.32k 15.59 GB ^1.7.3 slackup
115 487.37k 15.46 GB 3.3.2 @chakra-ui/cli
116 486.09k 15.42 GB ^2.7.0 grammy
117 478.72k 15.19 GB 2.7.0 @strapi/generate-new
118 475.76k 15.09 GB ^2.7.0 @getzep/zep-cloud
119 467.56k 14.83 GB ^2.6.7 avatax
120 465.11k 14.75 GB 2.7.0 @microsoft/teamsfx-core
121 448.06k 14.21 GB ^2.6.7 @apollo/datasource-rest
122 447.24k 14.19 GB ^3.0.0 node-fetch-retry
123 445.04k 14.12 GB 2.7.0 @usebruno/js
124 441.90k 14.02 GB ^3.3.2 @genkit-ai/ai
125 438.95k 13.92 GB 2.7.0 @capacitor/assets
126 433.41k 13.75 GB 2.6.7 near-api-js
127 432.94k 13.73 GB ^2.6.0 @serverless/component-metrics
128 431.36k 13.68 GB 2.7.0 @getzep/zep-js
129 412.31k 13.08 GB ^2.7.0 telegraf
130 398.75k 12.65 GB ^2.7.0 elevenlabs
131 396.76k 12.59 GB ^2.6.5 @stoplight/prism-http
132 392.09k 12.44 GB 2.6.7 @auto-it/core
133 389.82k 12.37 GB ^2.6.5 @stoplight/prism-http-server
134 385.60k 12.23 GB ^2.6.0 datadog-winston
135 385.54k 12.23 GB 2.7.0 @crowdin/cli
136 376.20k 11.93 GB ^2.3.0 @builder.io/sdk
137 374.69k 11.89 GB ^2.6.1 office-addin-cli
138 373.12k 11.84 GB ^2.6.7 @mux/mux-node
139 370.46k 11.75 GB ^2.3.0 semantic-release-slack-bot
140 366.11k 11.61 GB ^3.3.2 @genkit-ai/googleai
141 365.30k 11.59 GB ^2.6.0 all-contributors-cli
142 359.97k 11.42 GB ^2.7.0 @mergeapi/merge-node-client
143 358.29k 11.37 GB ^2.6.7 statsig-node-lite
144 356.61k 11.31 GB 2 notion-to-md they target 12.x
145 348.07k 11.04 GB 1.6.3 opencollective
146 346.35k 10.99 GB 3.3.2 @shopify/cli-kit
147 339.55k 10.77 GB ^2.2.0 get-graphql-schema
148 337.06k 10.69 GB ^2.6.7 @commercetools/sdk-middleware-auth
149 336.28k 10.67 GB ^2.6.0 bitbucket
150 324.72k 10.30 GB ^2.6.1 ember-fetch

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 171.11k 1.45 GB ^7.1.0 formiojs
2 170.39k 1.45 GB ^7.1.0 @citation-js/core
3 69.49k 589.41 MB ^7.1.0 @rockset/client
4 68.17k 578.19 MB ^4.0.0 @trufflesuite/eth-json-rpc-middleware
5 42.24k 358.28 MB ^7.1.0 @formio/core

@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