@pureq/pureq
v1.1.11
Published
Functional, immutable, and type-safe HTTP client layer with middleware composition.
Maintainers
Readme
pureq
Functional, immutable, and type-safe HTTP transport layer for TypeScript.
Getting Started | Documentation | Middleware Reference | GitHub
pureq is a policy-first transport layer that makes HTTP behavior explicit, composable, and observable across frontend, BFF, backend, and edge runtimes.
import { createClient, retry, circuitBreaker, dedupe } from "@pureq/pureq";
const api = createClient({ baseURL: "https://api.example.com" })
.use(dedupe())
.use(retry({ maxRetries: 2, delay: 200 }))
.use(circuitBreaker({ failureThreshold: 5, cooldownMs: 30_000 }));
const user = await api.getJson<User>("/users/:id", { params: { id: "42" } });Highlights
- Immutable client composition
- Onion model middleware
- Typed path params
- Result-based error handling
- No runtime dependencies
- Works in Node, browser, and edge runtimes
Documentation
- Getting Started
- Core Concepts
- API Reference
- Middleware Reference
- Error Handling
- Observability
- Migration Guide
- Benchmarks
License
MIT
