Install ofetch
You can install ofetch using your preferred package manager:Environment support
ofetch works across multiple JavaScript runtimes:- Node.js - Version 18 and above (uses native fetch)
- Browsers - All modern browsers with fetch support
- Workers - Cloudflare Workers, Service Workers, Web Workers
- Bun - Full support with native fetch
- Deno - Full support with native fetch
ofetch uses the native
fetch API available in your environment. For Node.js versions below 18, you may need a fetch polyfill.TypeScript support
ofetch is written in TypeScript and includes type definitions out of the box. No additional@types packages are required.