rate-limiter-flexible

Atomic and non-atomic counters and rate-limiting tools that protect against DoS and brute-force attacks at any scale

Library
npm
v11.2.0
3,582stars
ISC

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
65/100Good
Development Activity36
Maintenance64
Community60
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
77/100Good
Architecture82
Code Quality80
Innovation74
Learning Curve70

rate-limiter-flexible is a Node.js library for counting and limiting the number of events per key (IP address, user ID, API route, etc.), protecting applications from denial-of-service and brute-force attacks. It provides a unified API across a wide range of backing stores — Redis, Valkey, Memcached, MongoDB, MySQL, PostgreSQL, SQLite, DynamoDB, Prisma, Drizzle, etcd, in-process Memory, and Cluster/PM2 — so applications can start with an in-memory limiter and move to a distributed store without rewriting call sites.

Beyond basic point-consumption rate limiting, the library offers advanced composition primitives: RateLimiterUnion to combine multiple limiters as one, BurstyRateLimiter for traffic bursts, RateLimiterQueue for FIFO-ordered request queuing, block-and-insurance strategies for resilience when a backing store is unavailable, and black/white-list wrappers. It has no production dependencies in its core, ships bundled TypeScript declarations, and is used widely to protect login endpoints, APIs, and WebSocket connections from abuse.

What You Get

  • A unified consume/get/set/block/penalty/reward API that works identically across a dozen supported backing stores
  • Backends for Redis, Valkey, Memcached, MongoDB, MySQL, PostgreSQL, SQLite, DynamoDB, Prisma, Drizzle, etcd, in-process Memory, and Cluster/PM2
  • Composable strategies: RateLimiterUnion (combine limiters), BurstyRateLimiter (traffic bursts), RateLimiterQueue (FIFO queuing)
  • Resilience features: in-memory block strategy to reduce store round-trips, and an insurance limiter as a fallback if the primary store is down
  • Zero production dependencies in the core package, with bundled TypeScript type declarations
  • Documented middleware patterns for Express, Koa, and Hapi, plus community packages for GraphQL and NestJS

Common Use Cases

  • Protecting login and authentication endpoints from brute-force password-guessing attacks
  • Rate-limiting a public API per user or API key, with different limits for authorized vs. unauthorized traffic
  • Preventing WebSocket connection flooding by limiting connection attempts per client
  • Throttling third-party API calls or crawler/bot traffic to stay within upstream rate limits

Under The Hood

Architecture - The library is built around an abstract base (RateLimiterAbstract.js) that defines the shared point-consumption contract, with RateLimiterStoreAbstract.js extending it for store-backed limiters and each backend (Redis, Mongo, MySQL, Postgres, DynamoDB, Prisma, Drizzle, etcd, Memcache, Valkey, ValkeyGlide) implementing that contract as its own module under lib/; composition classes (RateLimiterUnion, BurstyRateLimiter, RateLimiterQueue, RLWrapperBlackAndWhite, RLWrapperTimeouts) wrap one or more limiter instances to add higher-level behavior without touching the store implementations. Tech Stack - Pure JavaScript with zero required production dependencies in the core; each store backend is an optional peer integration (works with ioredis/redis, @valkey/valkey-glide/iovalkey, mongodb/mongoose, mysql/mysql2, pg, sequelize/typeorm/knex, prisma, drizzle-orm, memcached), so consumers only pull in the client library for the store they use. Code Quality - The project has an extensive test/ suite with a dedicated test file per backend (e.g. RateLimiterRedis.test.js, RateLimiterMySQL.test.js, RateLimiterDynamo.test.js) plus component-level tests, reflecting the discipline needed to keep atomic-increment correctness across a dozen very different storage engines; 60 contributors and continuous releases (67 tagged versions) indicate sustained maintenance. API Design - Every limiter exposes the same consume(key, points) promise-based method regardless of backing store, so switching from RateLimiterMemory to RateLimiterRedis in production requires changing only the constructor call; the RateLimiterRes result object bundles msBeforeNext, remainingPoints, and consumedPoints in a form that maps directly onto standard rate-limit HTTP headers.

Used by 16 apps in this directory

TypeScript
76%
AGPL 3.0

Abby

Developer Tools · Product Management

167

Statically typed feature flags, remote config, and A/B testing with framework-native SDKs for TypeScript teams.

View details
30
Repo Health
70
Technical
63
Dependency
Built with
TypeScript76%
MDX18%
Updated 1 years ago
TypeScript
72%
AGPL 3.0

APITable

Low Code Platforms · Databases

15,526

API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.

View details
53
Repo Health
77
Technical
60
Dependency
Built with
TypeScript72%
Java22%
Updated 9 months ago
JavaScript
82%
Other

Countly

Analytics · Marketing

5,887

Privacy-first, self-hosted analytics and customer engagement platform with full data ownership, GDPR compliance, and AI-powered insights across mobile, web, desktop, and IoT.

View details
96
Repo Health
82
Technical
68
Dependency
Built with
JavaScript82%
Updated today
TypeScript
80%
Other

Directus

CMS · Low Code Platforms

37,462

Connect any SQL database and get instant REST and GraphQL APIs, a visual management Studio, and a native MCP server for AI agents — free for most organizations.

View details
93
Repo Health
82
Technical
78
Dependency
Built with
TypeScript80%
Vue18%
Updated yesterday
TypeScript
72%
AGPL 3.0

Firecrawl

AI Development · Developer Tools

169,311

Turn any website into clean, LLM-ready data with a single API call — no proxy headaches, no scraping complexity.

View details
89
Repo Health
83
Technical
66
Dependency
Built with
TypeScript72%
Python14%
Updated today
TypeScript
76%
Other

Joplin

Note Taking

56,003

The privacy-first, open-source note-taking app with end-to-end encrypted sync, AI assistance, and a powerful plugin ecosystem across every platform.

View details
93
Repo Health
87
Technical
62
Dependency
Built with
TypeScript76%
JavaScript15%
Updated yesterday
TypeScript
98%
AGPL 3.0

Kan

Project Management

5,357

An open-source, self-hostable Kanban board built as a modern Trello alternative with team workspaces, board permissions, and Trello import.

View details
85
Repo Health
78
Technical
67
Dependency
Built with
TypeScript98%
Updated 1 weeks ago
TypeScript
98%
Other

Langfuse

AI Development · Monitoring

33,366

Open source AI engineering platform for LLM observability, prompt management, evaluation, and debugging — self-host in minutes or use Langfuse Cloud.

View details
92
Repo Health
81
Technical
66
Dependency
Built with
TypeScript98%
Updated today
TypeScript
88%
Apache 2.0

Medplum

Developer Tools · Databases · Authentication

2,614

An open-source, FHIR-native healthcare platform that gives developers a compliant backend, authentication, a React component library, and serverless bots to build clinical applications in weeks instead of years.

View details
93
Repo Health
90
Technical
72
Dependency
Built with
TypeScript88%
MDX10%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search