Any Framework
First-class support for Hono, Express, H3/Nitro, and Nuxt. Same API everywhere.
Any Framework
First-class support for Hono, Express, H3/Nitro, and Nuxt. Same API everywhere.
Edge Ready
Works on Cloudflare Workers, Vercel Edge, Deno Deploy, and traditional Node.js servers.
Smart Algorithms
Cloudflare-style sliding window prevents burst attacks. Fixed window also available.
Distributed Storage
In-memory for development. Redis, Cloudflare KV, or Vercel KV for production.
| Package | Description | Use Case |
|---|---|---|
| @jfungus/ratelimit | Core algorithms + MemoryStore | Direct usage, custom integrations |
| @jfungus/ratelimit-hono | Hono middleware | Hono apps, Cloudflare Workers |
| @jfungus/ratelimit-express | Express middleware | Express.js applications |
| @jfungus/ratelimit-h3 | H3/Nitro middleware | Nitro servers, standalone H3 |
| @jfungus/ratelimit-nuxt | Nuxt module | Nuxt 3 applications |
| @jfungus/ratelimit-unstorage | Storage adapter | Redis, KV, distributed setups |
import { Hono } from "hono";import { rateLimiter } from "@jfungus/ratelimit-hono";
const app = new Hono();
// 100 requests per minute per IPapp.use( rateLimiter({ limit: 100, windowMs: 60 * 1000, // 1 minute }),);
app.get("/api/data", (c) => c.json({ success: true }));// With Redis for distributed deploymentsimport { createStorage } from "unstorage";import redisDriver from "unstorage/drivers/redis";import { createUnstorageStore } from "@jfungus/ratelimit-unstorage";
const store = createUnstorageStore({ storage: createStorage({ driver: redisDriver({ url: process.env.REDIS_URL }), }),});
app.use(rateLimiter({ limit: 100, windowMs: 60 * 1000, store })); // 1 minute