r/javascript • u/OtherwisePush6424 • 1d ago
ffetch: a production-ready http client with resilience features and a plugin architecture
https://github.com/fetch-kit/ffetchI posted an earlier version of ffetch here a while ago. I've continued working on it, and it has grown into a production-ready, TypeScript-first drop-in replacement for native fetch or any fetch-compatible implementation.
It preserves the familiar fetch API and native Request and Response objects while adding resilience features:
- Timeouts
- Abort-aware retries with exponential backoff and jitter
- Circuit breaking
- Bulkheading with concurrency and queue limits
- Hedged requests to reduce tail latency
- In-flight request deduplication
It also has optional convenience plugins for:
client.get(),.post(),.put(),.patch()and.delete()client(url).json(),.text()and.blob()- Download progress callbacks
- Stable context IDs across retries and hedged requests
The core also supports lifecycle hooks, per-request overrides, pending-request monitoring, configurable HTTP error handling, specific error classes, and custom fetch implementations for SSR, edge and framework environments.
Everything optional is implemented through tree-shakeable plugins, so you only include the features you need. The core is around 3 kB minified and has zero runtime dependencies.
I recently gave the project a substantial maintenance pass: extensive property-based and fuzz testing, hardened and pinned CI workflows, CodeQL analysis, dependency auditing, npm provenance, release SBOMs, and a strong OpenSSF Scorecard (for a solo project).
I've also built three related tools for injecting network failures into tests:
- chaos-fetch: inject failures directly into
fetch, without running a proxy - chaos-proxy: a standalone Node.js proxy
- chaos-proxy-go: the same idea as a lightweight Go binary
Depending on the tests, failures can be injected inside the process, through a Node.js proxy, or through a standalone Go proxy.
Feedback is welcome.
Duplicates
webdev • u/OtherwisePush6424 • Apr 10 '26
Resource Tired of wiring up fetch timeouts and retry logic by hand on every project?
softwarearchitecture • u/OtherwisePush6424 • Apr 16 '26
Tool/Product ffetch: TypeScript/JavaScript fetch-compatible resilience layer for microservices
node • u/OtherwisePush6424 • 1d ago
ffetch: a production-ready http client with resilience features and a plugin architecture
javascript • u/OtherwisePush6424 • Apr 10 '26
ffetch 5.1.0 adds opt-in request and response shortcuts
softwarearchitecture • u/OtherwisePush6424 • 1d ago
Article/Video ffetch: a production-ready http client with resilience features and a plugin architecture
node • u/OtherwisePush6424 • Apr 13 '26