Skip to content

err-require-esm/ooofetch

 
 

Repository files navigation

ooofetch (opinionated optimized ofetch)

npm version npm downloads bundle License JSDocs

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: 62KB
  • node-fetch-native: 739KB
  • ufo: 105KB
  • destr: 11KB
  • ooofetch: 28KB

License

MIT. Made with 💖

About

😱 A better ofetch. 0 dependencies, 3% install size

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 97.5%
  • JavaScript 2.5%