A zero-dependency, fixed-window, queued rate limiter for Axios (current stable version: 1.9.0). It automatically delays requests that exceed configurable per-interval limits. Supports multiple windows (e.g., per second and per minute), custom queue implementations, and works well with axios-retry and axios-cache-adapter. TypeScript types are included. Release cadence is low; updates are rare and maintenance-focused. Alternative to the built-in Axios rate-limiting (experimental).
npm install axios-rate-limitNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates an axios instance with a fixed-window rate limit of 5 requests per second.
Always pass the return value of rateLimit() to your application code.
Use `limits` array with `maxRequests` and `duration` (string or number in ms).
Use string format (e.g., '1s', '500ms') or number in milliseconds.
Only call rateLimit() once per axios instance.
Use default import: import rateLimit from 'axios-rate-limit'
Ensure the first argument is a valid axios instance: const http = rateLimit(axios.create(), options);
Install axios and import correctly: import axios from 'axios';