Ofetch Has a Free API That Most Developers Dont Know About
javascript
dev.to
Ofetch is a better fetch from UnJS. Works in Node, browsers, Workers with auto-retry and smart JSON. Usage import { ofetch } from "ofetch"; const users = await ofetch("/api/users"); const user = await ofetch("/api/users", { method: "POST", body: { name: "John" } }); Instance const api = ofetch.create({ baseURL: "https://api.example.com", headers: { Authorization: `Bearer ${token}` }, retry: 3 }); Key Features Universal (Node, Browser, Wo