UNPKG

@the-node-forge/api-rate-limit

Version:

A simple and efficient API rate limiter for JavaScript/TypeScript applications

13 lines (12 loc) 296 B
export interface RateLimitOptions { windowMs: number; maxRequests: number; } declare class RateLimiter { private requests; private windowMs; private maxRequests; constructor(options: RateLimitOptions); isAllowed(userId: string): boolean; } export default RateLimiter;