npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@hasan-akbari/advanced-http-client

v0.0.7

Published

Advanced Angular HttpClient with cache, inflight dedup, rate limit, debounce, queueing, batching, retry/backoff, timeout, logging.

Downloads

17

Readme

AdvancedHttpClient

npm version npm downloads license

Features of AdvancedHttpClientService

Demo

  • Live: https://hasan-akbari.github.io/angular-advanced-http-client/

Production‑grade Angular HTTP client that augments HttpClient with caching, inflight de‑duplication, rate limiting, debouncing, queueing/concurrency, batching, retry/backoff, timeout, and logging.


Highlights

| Capability | What it does | |---|---| | Cache | In‑memory cache with TTL for successful responses | | Inflight de‑dup | Merges equivalent requests; shares results via shareReplay | | Rate limit & Debounce | Controls call rate and merges rapid bursts | | Queue & Concurrency | Sequential or parallel processing with priority and capacity | | Batching | Combines payloads and distributes responses via selector | | Retry/Backoff | Retries with exponential/linear backoff and fallback | | Timeout | Per‑request timeout handling | | Logging | Structured logs with optional server shipping |

[!TIP] Use raw: true in tests to disable automatic de‑duplication when you need to observe concurrency precisely.


Installation

npm i @hasan-akbari/advanced-http-client
import { AdvancedHttpClientService } from '@hasan-akbari/advanced-http-client';
// Params and headers
import { HttpHeaders, HttpParams } from '@angular/common/http';
const params = new HttpParams().set('_limit', '5').set('_page', '2');
const headers = new HttpHeaders({ 'X-Mode': 'demo' });

http.send<any>('https://jsonplaceholder.typicode.com/posts', undefined, {
  method: 'GET', params, headers
}).subscribe();
// Inflight de‑dup and result sharing
http.get<any>('https://jsonplaceholder.typicode.com/posts/1').subscribe();
http.get<any>('https://jsonplaceholder.typicode.com/posts/1').subscribe();
// Raw mode to bypass de‑dup/shareReplay
http.get<any>('https://jsonplaceholder.typicode.com/posts/1', {}, { raw: true }).subscribe();
http.get<any>('https://jsonplaceholder.typicode.com/posts/1', {}, { raw: true }).subscribe();

Options Overview

| Option | Type / Example | Description | |---|---|---| | method | 'GET'|'POST'|... | HTTP verb for send() | | params | Plain object | Converted to HttpParams | | headers | Plain object | Converted to HttpHeaders | | raw | boolean | Bypass de‑dup; every call sends independently | | cacheDurationMs | number | TTL for caching successful responses | | debounceMs | number | Merge rapid calls; delays send | | rateLimitMs | number | Minimum gap between completions on same key | | queue | { enabled, mode, concurrency?, priority } | Sequential/parallel pipeline control | | batch | { enabled, key, size, intervalMs, combine, selector } | Group payloads and split responses | | retry | { attempts, backoff, baseDelayMs, maxDelayMs?, shouldRetry?, fallbackValue } | Resilience configuration | | timeoutMs | number | Per‑request timeout | | log | { enabled, level, sendToServer? } | Logging and optional server shipping | | debug | boolean | Console debugging alongside logs |

[!NOTE] Cache is process‑local and not durable. Use a persistent store if you need cross‑session caching.


Usage Patterns

// Cache successful responses for 30s
http.get('https://jsonplaceholder.typicode.com/posts/2', {}, { cacheDurationMs: 30000 }).subscribe();
// Debounce rapid calls; Rate‑limit enforces minimum spacing between completions
http.get('https://api.example.com/search', { q: 'ng' }, { debounceMs: 300 }).subscribe();
http.get('https://api.example.com/items', {}, { rateLimitMs: 1000 }).subscribe();
// Sequential queue
http.get('https://api.example.com/todos/1', {}, { queue: { enabled: true, mode: 'sequential', priority: 'normal' } }).subscribe();
http.get('https://api.example.com/todos/2', {}, { queue: { enabled: true, mode: 'sequential', priority: 'normal' } }).subscribe();
// Parallel with concurrency
http.get('https://api.example.com/comments', {}, { raw: true, queue: { enabled: true, mode: 'parallel', concurrency: 2, priority: 'high' } }).subscribe();
// Batching (GET) with combine/selector
const batchOpts = {
  method: 'GET',
  batch: {
    enabled: true,
    key: 'users-batch',
    size: 10,
    intervalMs: 0,
    combine: (arr: any[]) => arr.map(p => p.id),
    selector: (resp: any[], payload: any) => resp.find(u => u.id === payload.id)
  }
} as const;
http.send<any>('https://jsonplaceholder.typicode.com/users', { id: 1 }, batchOpts as any).subscribe();
// Retry with exponential backoff and fallback
http.get('https://jsonplaceholder.typicode.com/posts', {}, {
  retry: {
    attempts: 2,
    backoff: 'exponential',
    baseDelayMs: 50,
    maxDelayMs: 2000,
    shouldRetry: (err) => err.status >= 500,
    fallbackValue: { ok: true }
  }
}).subscribe(v => console.log('Result:', v));
// Timeout and logging
http.get('https://jsonplaceholder.typicode.com/posts', {}, {
  timeoutMs: 10,
  log: { enabled: true, level: 'basic' },
  debug: true
}).subscribe();

Compatibility

| Angular | RxJS | Node | |---|---|---| | ^17.3.0 | ^7.8.0 | 18+ recommended |


Build & Publish

  • Build: npx ng build advanced-http-client
  • Publish: cd dist/advanced-http-client && npm publish

License

MIT