MCPcopy Index your code
hub / github.com/aishek/axios-rate-limit

github.com/aishek/axios-rate-limit @1.9.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.9.0 ↗ · + Follow
34 symbols 80 edges 13 files 1 documented · 3% 1 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

axios-rate-limit

npm version npm downloads build status code coverage install size

Zero dependencies, fixed-window, queued rate limiter for Axios: set how many requests per interval should perform immediately, other will be delayed automatically.

Installing

npm install axios-rate-limit

Usage

import axios from 'axios';
import rateLimit from 'axios-rate-limit';

const http = rateLimit(axios.create(), {
  limits: [
    { maxRequests: 5, duration: '2s' },
    { maxRequests: 2, duration: '500ms' }
  ]
})
http.get('https://example.com/api/v1/users.json?page=1')
http.getQueue()

See source code for all available options.

Typical use cases

Alternatives

Consider using Axios built-in rate-limiting functionality.

Extension points exported contracts — how you extend this code

RateLimiter (Interface)
(no doc)
typings/index.d.ts
Queue (Interface)
(no doc)
typings/index.d.ts
AxiosRateLimiter (Interface)
(no doc)
typings/index.d.ts
AxiosRateLimiterConstructor (Interface)
(no doc)
typings/index.d.ts

Core symbols most depended-on inside this repo

axiosRateLimit
called by 57
src/index.js
push
called by 21
typings/index.d.ts
shift
called by 9
typings/index.d.ts
throwDurationError
called by 5
src/index.js
getQueueLength
called by 3
src/index.js
getLength
called by 3
typings/index.d.ts
enable
called by 3
typings/index.d.ts
parseDuration
called by 2
src/index.js

Shape

Function 26
Interface 4
Method 4

Languages

TypeScript100%

Modules by API surface

src/index.js13 symbols
typings/index.d.ts8 symbols
__tests__/queue-interface.js2 symbols
__tests__/options-behavior.js2 symbols
__tests__/helpers.js2 symbols
__tests__/options-validation.js1 symbols
__tests__/jest-mocking-example.js1 symbols
__tests__/duration.js1 symbols
__tests__/cancellation.js1 symbols
__tests__/cache-adapter-integration.js1 symbols
__tests__/basic.js1 symbols
__tests__/axios-retry-integration.js1 symbols

Used by 1 indexed graphs manifest dependencies, hub-wide

For agents

$ claude mcp add axios-rate-limit \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page