Skip to content

Introduction

What is @jfungus/ratelimit?

A rate limiting library for JavaScript and TypeScript that works across frameworks. One consistent API for Hono, Express, H3, Nuxt, and more.

Why Use It?

  • Framework-agnostic - Same configuration everywhere
  • Edge-ready - Works on Cloudflare Workers, Vercel Edge, Deno
  • Production-ready - Redis, KV storage for distributed deployments
  • Modern algorithms - Cloudflare-style sliding window prevents bursts

Architecture

┌─────────────────────────────────────────────────────────┐
│ Your Application │
├─────────────────────────────────────────────────────────┤
│ @jfungus/ratelimit-hono │ @jfungus/ratelimit-express │ ... │
├─────────────────────────────────────────────────────────┤
│ @jfungus/ratelimit │
│ (core algorithms + MemoryStore) │
├─────────────────────────────────────────────────────────┤
│ MemoryStore │ @jfungus/ratelimit-unstorage │
│ (built-in) │ (Redis, KV, etc.) │
└─────────────────────────────────────────────────────────┘

Packages

PackageDescription
@jfungus/ratelimitCore algorithms + MemoryStore
@jfungus/ratelimit-honoHono middleware
@jfungus/ratelimit-expressExpress middleware
@jfungus/ratelimit-h3H3/Nitro middleware
@jfungus/ratelimit-nuxtNuxt module
@jfungus/ratelimit-unstorageDistributed storage adapter

Algorithms

  • Sliding Window (default) - Smooth, no burst vulnerability
  • Fixed Window - Simple, predictable

Learn more in Algorithms.

Next Steps