On this page

Welcome to hitlimit

The fastest rate limiting library for JavaScript. One API that works everywhere.

Choose your runtime

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

app.ts
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

server.ts
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

Next Steps