ofetch
JSON →ofetch is a modern, cross-platform HTTP client that provides a simplified, "better fetch API" for Node.js, browsers, and web workers. It intelligently handles request and response parsing, automatically stringifying JSON bodies and parsing responses using `destr` for robustness. Key features include automatic error throwing with detailed `FetchError` objects, built-in retry mechanisms for transient network issues and specific status codes, and seamless handling of binary and stream responses. The current stable version is 1.5.1, with a major v2.0.0 release in alpha that will transition to an ESM-only architecture, remove external dependencies, and further reduce bundle size. ofetch differentiates itself by offering a consistent, feature-rich `fetch` experience across diverse JavaScript environments, abstracting away common boilerplate and error handling patterns.
Traffic · last 30 days ↓67% vs prev 7d
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇫🇮 Finland · 🇩🇪 Germany