A high-performance, extensible, and resilient rate limiting library for Node.js.
RateLock is a powerful and developer-friendly rate limiting solution for Node.js applications. It's designed to be fast, flexible, and easy to integrate into any project, from small services to large-scale distributed systems.
- Extensibility: RateLock is built around a core engine and modular storage adapters. This allows you to choose the right backend for your needs or even build your own.
- Performance: By leveraging atomic operations (like Redis Lua scripts) in its adapters, RateLock ensures that rate limiting checks are fast and free of race conditions.
- Developer Experience: With a clean, modern API and strong TypeScript support, RateLock is designed to be intuitive and easy to work with.
This monorepo contains the entire RateLock ecosystem. The primary user-facing packages are:
For detailed usage and installation instructions, please see the README.md file within each package's directory.
This repository includes a playground application in the apps/playground directory. It's a Next.js application designed to demonstrate and test the various rate limiting strategies in a visual way.
To run the playground:
pnpm devWe welcome contributions! To get started with development, follow these steps:
-
Clone the repository:
git clone https://github.com/saoudi-h/ratelock.git cd ratelock -
Install dependencies: This project uses
pnpmas its package manager.pnpm install
-
Build all packages: This monorepo is managed by Turborepo. To build all packages and applications:
pnpm build
-
Run tests: To run the test suite for the entire project:
pnpm test
This project is licensed under the MIT License - see the LICENSE file for details.