ratesync
v1.0.4
Published
Its A Rate-Limiting Lib That Help us to Pervent the API abuse
Maintainers
Readme
ratesync
A simple, pluggable rate limiting middleware for Express.js.
Features
- In-memory rate limiting
- Per-IP tracking
- Configurable window and limit
- Easy to plug into any Express app
Installation
npm install ratesync
import rateLimit from "ratesync"
const limiter = rateLimit({
windowMs: 60 * 1000, // Time window in milliseconds (default: 1 minute)
max: 5, // Max requests allowed per window per IP (default: 5)
message: "Too many requests. Please try again later.", // Response when limit is exceeded
});
const app = express();
app.use(limiter); // Apply to all routes
app.get("/", (req, res) => {
res.send("Welcome! You're within the rate limit.");
});
app.listen(3000, () => {
console.log("Server running on http://localhost:3000");
});
### LICENSE (MIT)*
MIT License
Copyright (c) 2025 Lakshya Rohila
Permission is hereby granted, free of charge, to any person obtaining a copy
...
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND...