DEV Community

Cover image for One rate limiter for Express, NestJS, and Bun published
Shayan M Hussain
Shayan M Hussain

Posted on • Edited on

One rate limiter for Express, NestJS, and Bun published

I got tired of installing different rate limiting packages for every framework.

Express? One package. NestJS? Different package. Bun? Good luck finding one.

So I built one that works everywhere:

hitlimit({ limit: 100, window: '15m' })
Enter fullscreen mode Exit fullscreen mode

Same config. Express, NestJS, Bun, Elysia — doesn't matter.

What's in it

  • All the stores — Memory, SQLite, Redis
  • Tiered limits — Free/Pro/Enterprise built in, no manual routing
  • Human time windows'15m' not 900000
  • Lightweight — ~7KB

Performance

I ran benchmarks. It's fast — competitive with or faster than the alternatives depending on the scenario. But realistically, rate limiting isn't your bottleneck unless you're at serious scale.

Benchmark scripts are in the repo if you want to verify.

Try it

npm install @joint-ops/hitlimit

# Bun
bun add @joint-ops/hitlimit-bun
Enter fullscreen mode Exit fullscreen mode

GitHub · Docs

It's brand new. Would love feedback — what's missing? What would make this useful for your projects?

Top comments (0)