Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
`, which automatically polyfills fetch globally if not supported, as shown in the polyfill usage examples."}},{"@type":"Question","name":"Does unfetch support sending FormData or Blob in requests?","acceptedAnswer":{"@type":"Answer","text":"Yes, unfetch supports common body types like FormData, JSON, Blob, and ArrayBuffer as per the options.body property, though with minimal implementation focused on core functionality."}}]}
  1. Home
  2. Tiny JS
  3. unfetch

unfetch

MITJavaScript5.0.0

A minimal 500-byte fetch polyfill for environments lacking native fetch support.

Visit WebsiteGitHubGitHub
5.7k stars202 forks0 contributors

What is unfetch?

Unfetch is a minimal fetch polyfill that provides the `fetch()` API for making HTTP requests in browsers that lack native support. It solves the problem of needing modern fetch functionality in legacy environments without adding significant bundle size. The implementation focuses on core features like headers and JSON/text responses while maintaining an extremely small footprint.

Target Audience

Frontend developers working on projects that must support older browsers (like IE8+) but want to use the fetch API without heavy polyfills. It's also suitable for developers building lightweight libraries or applications where bundle size is a critical concern.

Value Proposition

Developers choose Unfetch because it's the smallest fetch polyfill available—around 500 bytes gzipped—while still providing essential functionality. Its minimal approach avoids bloat and offers a familiar API, making it ideal for projects where every byte counts and full spec compliance isn't required.

Overview

🐕 Bare minimum 500b fetch polyfill.

Use Cases

Best For

  • Adding fetch support to legacy web applications targeting IE8+
  • Reducing bundle size in projects where other fetch polyfills are too large
  • Polyfilling fetch in lightweight JavaScript libraries or frameworks
  • Using fetch as a ponyfill in module-based builds without affecting globals
  • Hotlinking a fetch polyfill directly from a CDN like unpkg
  • Projects that need basic fetch functionality without streaming or advanced features

Not Ideal For

  • Projects requiring full Fetch API specification compliance, including streaming responses and iterable headers
  • Applications with complex authentication flows needing robust cookie and credential management beyond 'include'
  • Isomorphic JavaScript applications that need seamless fetch functionality on both browser and Node.js without additional packages
  • Use cases involving large file transfers or real-time data where response streaming is essential

Pros & Cons

Pros

Ultra-Lightweight Footprint

At only about 500 bytes gzipped, it's one of the smallest fetch polyfills, minimizing bundle size impact for performance-sensitive projects, as highlighted in the README's badges.

Broad Legacy Browser Support

Works in browsers as old as IE8+ when a Promise polyfill is present, enabling modern fetch API usage in outdated environments, making it a practical choice for legacy codebases.

Flexible Integration Options

Can be used as a polyfill to globally install fetch or as a ponyfill for module imports, offering versatility in different build setups, as shown in the usage examples.

Minimal Core Implementation

Focuses on essential features like headers and text/json responses, avoiding bloat from full spec compliance, which keeps the API simple and familiar for basic use cases.

Cons

Incomplete Specification Support

Missing advanced Fetch spec features like streaming, full Headers class implementation, and uses Arrays instead of Iterables, which may cause compatibility issues in edge cases, as admitted in the README.

Limited Cookie and Credential Handling

Only supports 'credentials: "include"' and lacks 'same-origin', making it inadequate for applications requiring precise control over cookie sending in CORS scenarios, as noted in the caveats.

No Native Node.js Compatibility

Designed solely for browsers; server-side usage requires the separate isomorphic-unfetch package, adding overhead for universal JavaScript applications, which is a documented limitation.

Frequently Asked Questions

Quick Stats

Stars5,717
Forks202
Contributors0
Open Issues20
Last commit2 years ago
CreatedSince 2017

Tags

#ponyfill#polyfill#lightweight#tiny#legacy-browser-support#ajax#fetch#browser-compatibility#http-client

Built With

E
ES2015

Links & Resources

Website

Included in

Tiny JS767
Auto-fetched 1 day ago

Related Projects

wretchwretch

A tiny wrapper built around fetch with an intuitive syntax. :candy:

Stars5,165
Forks107
Last commit9 days ago
redaxiosredaxios

The Axios API, as an 800 byte Fetch wrapper.

Stars4,882
Forks104
Last commit2 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub