A lightweight, universal HTTP client built on the standard Fetch API. First-class support for streaming, Server-Sent Events (SSE), and progress tracking.
Works on Browser, Node.js 18+, Bun, Deno, and Angular 17+.
- Streaming — Text and binary streaming with chunk-by-chunk processing
- Server-Sent Events — Full SSE spec with auto-reconnect and Last-Event-ID
- Progress Tracking — Upload and download progress on all platforms
- Interceptors — Middleware system with built-in auth, logging, CSRF, and header interceptors
- Angular Integration — RxJS Observable wrapper with dependency injection support
- TypeScript — Complete type definitions with generics
- Zero Dependencies — ~4KB minified + gzipped
npm install fetchquackimport { HttpClient } from 'fetchquack';
const client = new HttpClient();
// JSON request
const user = await client.fetch<User>({
method: 'GET',
url: '/api/users/1'
});
// Streaming
const controller = new AbortController();
client.fetchStream({
method: 'POST',
url: '/api/ai/chat',
body: { prompt: 'Hello!' },
signal: controller.signal,
decodeToString: true,
onData: (chunk) => console.log(chunk),
onComplete: () => console.log('Done')
});
// Server-Sent Events
client.sse({
method: 'GET',
url: '/api/events',
signal: controller.signal,
autoReconnect: true,
onEvent: (event) => console.log(event.data)
});- Getting Started
- HTTP Client
- Requests & Responses
- Interceptors
- Streaming
- Server-Sent Events
- Progress Tracking
- Retry Policies
- Angular Integration
- API Reference
| Runtime | Version |
|---|---|
| Browser | Modern browsers |
| Node.js | 18.0+ |
| Bun | 1.0+ |
| Deno | 1.11+ |
See README-tests.md for testing documentation.
Contributions are welcome! Please fork the repository, create a feature branch, and open a pull request.
MIT © Adrián Bueno Jiménez
