ooofetch (opinionated optimized ofetch)
A better ofetch.
🚀 Quick Start
Install:
pnpm add ofetch@npm:ooofetch
Import:
import { ofetch } from 'ofetch'
✔️ All the features you know and love, but without the unnecessary polyfills.
ooofetch retains the core functionality of ofetch while removing dependencies on node-fetch-native and undici.
It is now 2025, and Node.js < 20 have reached their end-of-life.
✔️ ESM-only
Since I'm already using ESM, why bother downloading extra code I'll never use?
Read more about: https://antfu.me/posts/move-on-to-esm-only
✔️ Pre-compile dependencies
ofetch internally uses ufo and destr, but in practice only utilizes a small portion of ufo.
with pre-compile ufo and destr, we successfully reduced the deps size from 116KB to approximately 8KB. (including types)
Read more about: https://e18e.dev/blog/bundling-dependencies.html
✔️ Small, Smaller, Smallest
Now it's time for us to compare with ofetch.
ofetch@1.4.1 (916KB)
- ofetch: 62KB
- node-fetch-native: 739KB
- ufo: 105KB
- destr: 11KB
ooofetch@2.0.0-beta.5 (28KB)
- ooofetch: 28KB
License
MIT. Made with 💖