whatwg-fetch
A lightweight polyfill bringing the window.fetch API to browsers that lack native support
Repository Health
Technical Analysis
whatwg-fetch is a polyfill implementation of the WHATWG Fetch specification, providing window.fetch, Request, Response, and Headers globals for browsers and environments that don’t natively support the Fetch API. It was originally maintained under GitHub’s own github/fetch organization (the repository has since transferred to its original author, JakeChampion) and became one of the most widely depended-on polyfills in the npm ecosystem during the transition away from XMLHttpRequest-based HTTP calls.
The library is a single-file implementation (fetch.js) with no runtime dependencies, designed to be dropped into any project needing standards-compliant fetch behavior in legacy environments, and is commonly pulled in transitively by build tooling and older browser-support configurations.
What You Get
- A drop-in polyfill for
window.fetch,Request,Response, andHeaders - Standards-aligned behavior matching the WHATWG Fetch specification
- Zero runtime dependencies, distributed as a single small JS file
- UMD and ES module builds for use with bundlers or via a
<script>tag - Long-standing browser test coverage via Karma across Chrome, Firefox, and Safari launchers
Common Use Cases
- Supporting fetch-based HTTP calls in older browsers (legacy IE/Edge, older Safari) that lack native fetch
- Providing a consistent fetch implementation in test/CI environments (e.g. jsdom) that don’t implement fetch
- Bundled transitively into build tooling or UI libraries that assume fetch is globally available
- Server-side or non-browser JS environments needing a spec-compliant fetch surface without a full HTTP client
Under The Hood
Architecture: The entire polyfill lives in a single fetch.js file (~640 lines) that conditionally defines self.fetch only if it’s not already present, implementing Headers, Request, Response, and Body as constructor functions backed by XMLHttpRequest under the hood for the actual network transport — the Fetch-shaped API is a wrapper translating Fetch semantics (streams, promises) onto XHR’s callback-based model.
Tech Stack: Plain ES5-compatible JavaScript with no runtime dependencies; built via Rollup (rollup.config.js) to produce UMD and ES module bundles, tested with Karma against real browser launchers (Chrome, Firefox, Safari) rather than a headless DOM shim, which is notable rigor for a polyfill of this vintage.
Code Quality: The test/test.js suite exercises Fetch-spec edge cases (header case-insensitivity, response cloning, body-already-used errors) rather than just happy-path calls. The single-file design keeps the surface area small and easy to audit, though the project has seen no commits since mid-2024, meaning it now trails the evolving Fetch spec (e.g. newer Request/Response options) rather than actively tracking it.
API Design: By design, the polyfill’s API is not its own — it faithfully mirrors the native fetch()/Request/Response/Headers globals, so there is effectively zero learning curve for anyone already familiar with the standard Fetch API; usage is simply importing the package for its side effect of defining the global.
Used by 16 apps in this directory
Plasmic
CMS · Design Tools · Low Code Platforms
The open-source visual builder that lets teams design React apps and websites with drag-and-drop while integrating seamlessly with your codebase.
Rocket.Chat
Team Chat
The secure, self-hosted team communications platform for organizations that cannot compromise on data sovereignty.
strapi
CMS
Open-source headless CMS that auto-generates REST and GraphQL APIs from your content models, with a fully customizable admin panel you control.
Teleport
Authentication · Security
Zero-trust infrastructure access platform that replaces credentials and VPNs with short-lived certificates, SSO, and identity-aware proxies for SSH, Kubernetes, databases, RDP, and AI agents.
Twake Drive
Collaboration · File Storage
Open-source, self-hosted file manager with collaborative drives, AI-powered summarization, and OnlyOffice document editing for teams who want full data sovereignty.
Unleash
Ab Testing Experimentation · Developer Tools · Devops
The open-source feature management platform that lets you ship code to production and control who sees it — without redeploying.
Wiki.js
Collaboration · Knowledge Management
A modern, self-hosted wiki platform built on Node.js with a rich plugin ecosystem for authentication, search, storage, and rendering that adapts to any team's infrastructure.