Polyfill for the global fetch API in Node.js using the undici HTTP client. Version 1.2.1, stable. Provides a lightweight, standards-compliant fetch implementation for Node.js versions that lack it, with automatic proxy support via environment variables. Different from other fetch polyfills by being based on undici, which is the official Node.js HTTP client for HTTP/1.1 and HTTP/2.
npm install fetch-undici-polyfillNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates importing the polyfill as a side-effect and using the global fetch to make an HTTP request.
Use `import 'fetch-undici-polyfill'` without assignment.
Use only in Node.js scripts; for browser, use native fetch or a different polyfill.
Pin undici to v5 if using older node versions, or update to latest fetch-undici-polyfill.
Run `npm install undici` to install the required peer dependency.
Add `import 'fetch-undici-polyfill'` at the top of your entry file.