Settings

Theme

A lightweight, production-ready drop-in replacement for native fetch

npmjs.com

2 points by gkoos 4 months ago · 1 comment

Reader

gkoosOP 4 months ago

In every JS/TS project, be it frontend or backend, you usually have to fetch some data. And when you go into production, you realise you need something more resilient than the native fetch.

There are some libraries on npm, but I found them either too dumb or doing too much, so I built my own.

- Timeouts - per-request or global - Retries - user-defined, defaults to exponential back-off + jitter - Circuit breaker - trip after N failures - Hooks - logging, auth, metrics, request/response transformation - Per-request overrides - customize behavior on a per-request basis - Universal - Node, Browser, Cloudflare Workers, React Native - Zero runtime deps - ships as dual ESM/CJS - Written in TypeScript

Any feedback is welcome, here or in the github repo (https://github.com/gkoos/ffetch).

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection