Skip to content

A modular toolkit for building resilient HTTP clients. Provides pluggable caching, adaptive rate limiting, request deduplication, and more. Use the full client or just the pieces you need.

License

Notifications You must be signed in to change notification settings

AllyMurray/http-client-toolkit

Repository files navigation

HTTP Client Toolkit

A modular HTTP client toolkit with pluggable caching, deduplication, and rate limiting. Each concern is implemented as a standalone store that can be used independently or composed together.

Documentation

Packages

Package Description
@http-client-toolkit/core HTTP client and store interfaces
@http-client-toolkit/store-memory In-memory store implementations
@http-client-toolkit/store-sqlite SQLite-backed store implementations
@http-client-toolkit/store-dynamodb DynamoDB-backed store implementations

Quick Start

npm install @http-client-toolkit/core @http-client-toolkit/store-memory
import { HttpClient } from '@http-client-toolkit/core';
import {
  InMemoryCacheStore,
  InMemoryDedupeStore,
  InMemoryRateLimitStore,
} from '@http-client-toolkit/store-memory';

const client = new HttpClient(
  {
    cache: new InMemoryCacheStore(),
    dedupe: new InMemoryDedupeStore(),
    rateLimit: new InMemoryRateLimitStore(),
  },
  { defaultCacheTTL: 300 },
);

const data = await client.get<{ name: string }>(
  'https://api.example.com/user/1',
);

Every store is optional. Use only what you need.

Requires Node.js >= 20.

Development

pnpm install
pnpm build
pnpm test
pnpm lint

License

ISC

About

A modular toolkit for building resilient HTTP clients. Provides pluggable caching, adaptive rate limiting, request deduplication, and more. Use the full client or just the pieces you need.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages