Show HN: Safe-fetch 1.0 – type-safe fetch wrapper (no try/catch, RQ adapter)

1 asouei 0 9/5/2025, 3:55:12 PM github.com ↗
I released safe-fetch 1.0, a tiny (~3kb, zero deps) wrapper around Fetch:

No try/catch: always returns { ok, data | error }

Normalized errors (NetworkError, TimeoutError, HttpError, ValidationError)

Dual timeouts (per attempt + total)

Smart retries with exponential backoff + Retry-After

New: React Query adapter (0.1 experimental) to remove unwrap boilerplate

GitHub: https://github.com/asouei/safe-fetch

NPM: https://www.npmjs.com/package/@asouei/safe-fetch

Comments (0)

No comments yet