Welcome to hitlimit
The fastest rate limiting library for JavaScript. One API that works everywhere.
Choose your runtime
Node.js
@joint-ops/hitlimit
Express, Fastify, Hono, NestJS, and raw Node.js HTTP. 5.96M+ ops/sec.
$ npm i @joint-ops/hitlimit
Get Started
Bun
@joint-ops/hitlimit-bun
Bun.serve, Elysia, and Hono on Bun. 7.73M+ ops/sec with native bun:sqlite.
$ bun add @joint-ops/hitlimit-bun
Get Started
Not sure? Both use the same API and config. Start with your runtime and switch anytime.
What is hitlimit?
hitlimit is a high-performance rate limiting library for JavaScript. It provides sub-millisecond request throttling with built-in support for tiered limits, multiple storage backends (Memory, SQLite, Redis, Postgres), and 8 framework adapters across Node.js and Bun.
Key Features
- Blazing fast — 5.96M ops/sec (Node.js) to 7.73M ops/sec (Bun)
- Zero config — one line to start, human-readable time windows
- 4 storage backends — Memory, SQLite, Redis, and Postgres
- Built-in tiered limits — Free, Pro, Enterprise in one config object
- 100% TypeScript — fully typed, zero dependencies
Quick Example
import express from 'express'
import { hitlimit } from '@joint-ops/hitlimit'
const app = express()
app.use(hitlimit({ limit: 100, window: '1m' }))
app.get('/', (req, res) => res.json({ message: 'Hello!' }))
app.listen(3000) Supported Frameworks
- Express — Drop-in middleware
- Fastify — Native plugin
- Hono — Middleware adapter
- NestJS — Module + Guard
- Node.js HTTP — Raw server support
Next Steps
Quick Example
import { hitlimit } from '@joint-ops/hitlimit-bun'
const limiter = hitlimit({ limit: 100, window: '1m' })
Bun.serve({
port: 3000,
async fetch(req) {
const result = await limiter.check(req)
if (!result.allowed) {
return new Response('Rate limited', { status: 429 })
}
return new Response('Hello from Bun!')
}
}) Supported Frameworks
- Bun.serve — Native adapter
- Elysia — Native plugin
- Hono — Middleware adapter