4 snippets · production-ready JavaScript & TypeScript
A TypeScript pattern for creating type-safe API clients where request parameters and response types are automatically inferred from a route definition object, eliminating the need for code generation tools.
A production-ready TypeScript utility that wraps fetch with an in-memory cache using Map, supports TTL-based expiration, and deduplicates concurrent requests to the same URL.
A production-ready TypeScript wrapper around fetch that validates API responses against Zod schemas at runtime, providing full type safety and structured error handling.
A production-ready TypeScript RateLimiter class that enforces rate limits on API calls by queuing excess requests and automatically processing them when the rate limit window resets.