Quick Start
Installation
Choose the package for your framework:
# For Hononpm install @jfungus/ratelimit-hono
# For Expressnpm install @jfungus/ratelimit-express
# For H3/Nitronpm install @jfungus/ratelimit-h3
# For Nuxtnpm install @jfungus/ratelimit-nuxtPackage Guides
Each package has detailed documentation:
- @jfungus/ratelimit-hono - Hono & Cloudflare Workers
- @jfungus/ratelimit-express - Express.js
- @jfungus/ratelimit-h3 - H3 & Nitro
- @jfungus/ratelimit-nuxt - Nuxt 3
Configuration Options
All packages share these common options:
| Option | Type | Default | Description |
|---|---|---|---|
limit | number | 100 | Maximum requests per window |
windowMs | number | 60000 | Window duration in milliseconds |
algorithm | 'fixed-window' | 'sliding-window' | 'sliding-window' | Rate limiting algorithm |
store | RateLimitStore | MemoryStore | Storage backend |
keyGenerator | function | IP-based | Function to generate client key |
skip | function | - | Function to skip rate limiting |
handler | function | 429 response | Custom rate limit response |
dryRun | boolean | false | Log but don’t block |
Next Steps
- Algorithms - Learn about fixed vs sliding window
- Stores - Use Redis or other distributed stores
- @jfungus/ratelimit-unstorage - Storage adapter for production