Welcome to hitlimit
hitlimit is a blazing-fast, production-ready rate limiting library for Node.js and Bun. Built from the ground up for performance and developer experience, it provides everything you need to protect your APIs from abuse while maintaining sub-millisecond overhead.
Why hitlimit?
Lightning Fast
Sub-millisecond overhead with optimized algorithms. Benchmarked at 200K+ req/s on modern hardware.
Universal
Works with Express, NestJS, Bun.serve, Elysia, and raw Node.js HTTP. One API, any framework.
Production Ready
Battle-tested stores (Memory, SQLite, Redis), comprehensive error handling, and monitoring support.
Developer Friendly
TypeScript-first design, intuitive API, and detailed documentation with real-world examples.
Quick Example
Get started in seconds with a simple Express app:
import express from 'express'
import { hitlimit } from '@joint-ops/hitlimit'
const app = express()
// Apply rate limiting: 100 requests per minute
app.use(hitlimit({ limit: 100, window: '1m' }))
app.get('/api/data', (req, res) => {
res.json({ message: 'Hello World!' })
})
app.listen(3000) That's it! Your API is now protected with production-grade rate limiting.
Performance
hitlimit is built for speed. Here's how it performs:
| Store | Throughput | Latency (p95) |
|---|---|---|
| Memory | 200K req/s | 0.1ms |
| SQLite | 180K req/s | 0.15ms |
| Redis | 95K req/s | 0.45ms |
Benchmarked on Apple M1 Max with 64GB RAM
Getting Started
Installation
Install hitlimit for Node.js or Bun
Quick Start
Get up and running in 5 minutes
Configuration
Explore all configuration options
Examples
Real-world examples and patterns
Community & Support
- GitHub: github.com/JointOps/hitlimit-monorepo
- npm: @joint-ops/hitlimit
License
MIT License - Use hitlimit freely in your projects, commercial or otherwise.