minor fixes

This commit is contained in:
Sumit Kumar 2024-09-27 12:22:15 +05:30
parent d8e9106a40
commit f435228f00
4 changed files with 5 additions and 8 deletions

View file

@ -85,7 +85,7 @@ app.use((req, res, next) => {
If you'd like to contribute or modify the package, you can clone the repository and run it locally: If you'd like to contribute or modify the package, you can clone the repository and run it locally:
```bash ```bash
git clone https://github.com/yourusername/rate-limiter.git git clone https://git.digimantra.com/abad_dml/rate-limiter
cd rate-limiter cd rate-limiter
npm install npm install
``` ```
@ -111,7 +111,7 @@ If you encounter any problems or have any questions, feel free to open an issue
## Links ## Links
- **GitHub**: [https://github.com/yourusername/rate-limiter](https://github.com/yourusername/rate-limiter) - **GitHub**: [https://git.digimantra.com/abad_dml/rate-limiter](https://git.digimantra.com/abad_dml/rate-limiter)
- **NPM**: [https://www.npmjs.com/package/rate-limiter](https://www.npmjs.com/package/rate-limiter) - **NPM**: [https://www.npmjs.com/package/rate-limiter-digimantra](https://www.npmjs.com/package/rate-limiter-digimantra)
--- ---

View file

@ -1,4 +1,3 @@
// index.js
const RateLimiter = require('./lib/rateLimiter'); const RateLimiter = require('./lib/rateLimiter');
// Middleware wrapper for Express.js or any other Node.js framework // Middleware wrapper for Express.js or any other Node.js framework

View file

@ -1,5 +1,3 @@
// lib/rateLimiter.js
class RateLimiter { class RateLimiter {
constructor({ windowMs, maxRequests }) { constructor({ windowMs, maxRequests }) {
// windowMs is the time window in milliseconds (e.g., 15 minutes = 15 * 60 * 1000) // windowMs is the time window in milliseconds (e.g., 15 minutes = 15 * 60 * 1000)

View file

@ -1,6 +1,6 @@
{ {
"name": "rate-limiter", "name": "rate-limiter-digimantra",
"version": "1.0.0", "version": "1.1.0",
"description": "Custom rate limiting middleware for Node.js", "description": "Custom rate limiting middleware for Node.js",
"main": "index.js", "main": "index.js",
"keywords": [ "keywords": [