whatwg-fetch

A lightweight polyfill bringing the window.fetch API to browsers that lack native support

Library
npm
v3.6.20
25,832 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
56 /100 Fair
Development Activity 0
Maintenance 32
Community 92
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
75 /100 Good
Architecture 72
Code Quality 78
Innovation 55
Learning Curve 95

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, and Headers
  • 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

TypeScript
90%
MIT

Plasmic

CMS · Design Tools · Low Code Platforms

7,125

The open-source visual builder that lets teams design React apps and websites with drag-and-drop while integrating seamlessly with your codebase.

View details
81
Repo Health
78
Technical
64
Dependency
Built with
TypeScript 90%
Updated 6 days ago
TypeScript
97%
Other

Rocket.Chat

Team Chat

46,304

The secure, self-hosted team communications platform for organizations that cannot compromise on data sovereignty.

View details
96
Repo Health
79
Technical
63
Dependency
Built with
TypeScript 97%
Updated 5 days ago
TypeScript
89%
Other

strapi

CMS

73,368

Open-source headless CMS that auto-generates REST and GraphQL APIs from your content models, with a fully customizable admin panel you control.

View details
93
Repo Health
84
Technical
63
Dependency
Built with
TypeScript 89%
JavaScript 11%
Updated 6 days ago
Go
75%
AGPL 3.0

Teleport

Authentication · Security

21,016

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.

View details
94
Repo Health
81
Technical
68
Dependency
Built with
Go 75%
TypeScript 16%
Updated 1 weeks ago
JavaScript
74%
AGPL 3.0

Twake Drive

Collaboration · File Storage

989

Open-source, self-hosted file manager with collaborative drives, AI-powered summarization, and OnlyOffice document editing for teams who want full data sovereignty.

View details
91
Repo Health
78
Technical
71
Dependency
Built with
JavaScript 74%
TypeScript 25%
Updated 6 days ago
TypeScript
97%
Apache 2.0

Unleash

Ab Testing Experimentation · Developer Tools · Devops

13,899

The open-source feature management platform that lets you ship code to production and control who sees it — without redeploying.

View details
91
Repo Health
84
Technical
69
Dependency
Built with
TypeScript 97%
Updated 6 days ago
TypeScript
41%
AGPL 3.0

Wiki.js

Collaboration · Knowledge Management

29,081

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.

View details
95
Repo Health
67
Technical
60
Dependency
Built with
TypeScript 41%
Vue 39%
JavaScript 16%
Updated 5 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers