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
APITable
Low Code Platforms · Databases
API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.
ByteChef
Automation · AI Agents
Unified open-source platform for AI agent orchestration and workflow automation with 180+ connectors, MCP support, and durable execution.
CodeSandbox
Code Editors · Developer Tools
Instantly ready browser-based IDE that runs full npm dependency resolution and transpilation entirely client-side, with no server needed.
Flagsmith
Developer Tools · Devops · Ab Testing Experimentation
Open-source feature flagging, remote config, and A/B/multivariate testing platform for web, mobile, and server-side apps — self-host or use the hosted SaaS.
Grafana
Monitoring · Analytics
The open-source observability platform that unifies metrics, logs, and traces from any data source into dynamic, queryable dashboards.
Kibana
Analytics · Monitoring
Your open source window into the Elastic Stack — query, visualize, and act on data stored in Elasticsearch with real-time dashboards, AI-assisted search, and automated alerting.
Langflow
AI Agents · AI Development
Build, test, and deploy AI agents and RAG workflows visually with native API and MCP server export.
MLflow
AI Development · Monitoring
The open source AI engineering platform for debugging, evaluating, monitoring, and optimizing production LLMs and agents at scale.
Onyx
AI Assistants · AI Agents · Knowledge Management
Self-hostable AI platform with agentic RAG, 50+ connectors, deep research, code execution, and support for every major LLM provider.