A lightweight rate-limiting utility for axios that throttles request-per-second rate globally without requiring a new axios instance. Version 1.0.0 is the latest stable release. Unlike alternatives like axios-throttled, it applies throttling directly to the global axios object, so all axios calls in the project are automatically rate-limited without changing imports. Ships TypeScript type definitions. Requires axios as a peer dependency with any version. Useful for API clients to avoid hitting rate limits.
npm install axios-request-throttleNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates applying global throttle of 2 requests per second to axios and making concurrent requests.
Use separate axios instances or a per-instance throttling solution like axios-throttled.
Set a reasonable requestsPerSecond value and consider adding a timeout or limiting total queued requests.
Implement retry logic with exponential backoff in your axios request interceptor or use a library like axios-retry.
Use: import axiosThrottle from 'axios-request-throttle'; then axiosThrottle.use(...)
Ensure you pass the same axios object you use for requests. Check that requestsPerSecond is a positive number.
Use: const axiosThrottle = require('axios-request-throttle').default; or switch to ESM imports.