A better ofetch.
Install:
pnpm add ofetch@npm:ooofetch
Import:
import { ofetch } from 'ofetch'
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.
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
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
Now it's time for us to compare with ofetch.
- ofetch: 62KB
- node-fetch-native: 739KB
- ufo: 105KB
- destr: 11KB
- ooofetch: 28KB
MIT. Made with 💖