🌐 Universal
Works on Browser, Node.js, Bun, and Deno with zero configuration
🌐 Universal
Works on Browser, Node.js, Bun, and Deno with zero configuration
🌊 Streaming
First-class support for streaming responses (text and binary)
📡 Server-Sent Events
Full SSE spec support with auto-reconnect and Last-Event-ID
⏳ Progress Tracking
Upload and download progress monitoring on all platforms
🔄 Interceptors
Powerful middleware system (auth, logging, retry, etc.)
🅰️ Angular 17+ Integration
RxJS Observable wrapper with injection context support
🔒 Type-Safe
Complete TypeScript definitions with generics
📦 Zero Dependencies
No runtime dependencies, just the Fetch API
🪶 Lightweight
~4KB minified + gzipped (browser bundle)
npm install fetchquackimport { HttpClient } from 'fetchquack';
const client = new HttpClient();
// Simple, typed requestsconst user = await client.fetch<User>({ method: 'GET', url: '/api/users/1'});
console.log(user.name);import { HttpClient } from 'fetchquack';
const client = new HttpClient();
// Stream AI responses chunk by chunkconst controller = new AbortController();let response = '';
client.fetchStream({ method: 'POST', url: '/api/ai/chat', body: { prompt: 'Explain HTTP streaming' }, decodeToString: true, signal: controller.signal, onData: (chunk) => { response += chunk; updateUI(response); // Real-time updates }, onComplete: () => console.log('Done')});
// Cancel at any time// controller.abort();import { HttpClient } from 'fetchquack';
const client = new HttpClient();
// SSE with auto-reconnectconst controller = new AbortController();
client.sse({ method: 'GET', url: '/api/events', autoReconnect: true, parseJson: true, signal: controller.signal, onEvent: (event) => { console.log(event.data); }});
// Close the connection// controller.abort();import { HttpClient } from 'fetchquack';
const client = new HttpClient();
// Monitor upload progressawait client.fetch({ method: 'POST', url: '/api/upload', body: file, onUploadProgress: (progress) => { progressBar.style.width = `${progress.percentage}%`; }});
// Monitor download progressawait client.fetch({ method: 'GET', url: '/api/download', onDownloadProgress: (progress) => { progressBar.style.width = `${progress.percentage}%`; }});import { NgxHttpClient } from "fetchquack/ngx";
// Angular with RxJS@Component({...})export class ChatComponent {
private http = inject(NgxHttpClient); response = signal('');
streamChat(prompt: string) { this.http.fetchStream({ method: 'POST', url: '/api/ai/chat', body: { prompt }, decodeToString: true }).pipe( takeUntilDestroyed() ).subscribe(chunk => { this.response.update(r => r + chunk); }); }}