Skip to content
Open source · built for Node.js

Shape traffic.
Keep breathing.

A focused rate-limiting library with three proven algorithms, atomic Redis coordination, and one API that stays out of your framework.

$npm i limix
3Algorithmsone clean contract
2Storeslocal or shared
1Small APIconsume and decide
traffic monitor
live
72remaining
Current windowHealthy headroom28 of 100 requests consumed
200user_72a14msallow
200tenant_orbit3msallow
429api_91bd2mslimit

No middleware lock-in and no sprawling configuration surface. Create a limiter, choose where its state lives, and consume against any identifier that matters to your application.

01
Install the package

It ships with types and has no framework opinions.

terminal
$ npm install limix
limit.ts
import {
Algorithms,
createRateLimiter,
MemoryStore,
} from 'limix';
const limiter = createRateLimiter({
algorithm: Algorithms.FIXED_WINDOW,
limit: 100,
windowMs: 60_000,
store: new MemoryStore(),
});
const decision = await limiter.consume('user_42');
if (!decision.allowed) {
// Return 429, delay the job, or apply your own policy.
}

The package returns the decision and useful limit metadata. Your transport layer decides what happens next.

Redis coordination

One decision. One atomic operation.

Lua-backed updates keep concurrent requests from slipping through the same opening.

Portable policy

Framework optional.

Use the same limiter in Express, workers, queues, cron jobs, or plain Node.

HTTPjobsworkers

Rate limiting is a traffic-shaping decision, not a checkbox. Use the lab to get a feel for how each strategy responds to the same uneven stream.

Traffic lab

See the trade-off, not just the name.

Local first. Distributed when you need it.

Section titled “Local first. Distributed when you need it.”

Use the memory store for development, tests, and single-process workloads. Move to Redis when several application instances must agree on the same limit.

MemoryBuilt in

Tests, scripts, and a single application process.

Local onlyNo infrastructure
RedisDistributed

Production APIs, workers, and multiple instances.

Shared stateBring Redis
One more thing

Add it to your first route.

Build your first limiter One package, no dashboard to sign into — you'll be done before the coffee is.