@canmertinyo/rate-limit-express 1.3.6 → 1.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/storages/mongo.storage.js +0 -2
- package/dist/storages/redis.storage.js +1 -0
- package/package.json +36 -27
package/README.md
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# Express Rate Limiter
|
2
2
|
|
3
|
-
###
|
3
|
+
### This middleware helps to restrict the number of requests a client can make within a given time period. It's ideal for lightweight use cases and can be easily extended with in-memory, Redis, or MongoDB as storage options.
|
4
4
|
|
5
5
|
To install :
|
6
6
|
|
7
|
-
```
|
8
|
-
npm
|
7
|
+
```bash
|
8
|
+
npm install express @canmertinyo/rate-limit-express ioredis mongoose
|
9
9
|
```
|
10
10
|
|
11
11
|
# Example usage :
|
@@ -13,8 +13,6 @@ exports.MongoStorage = void 0;
|
|
13
13
|
const mongoose_1 = require("mongoose");
|
14
14
|
const rate_limit_schema_1 = require("./schemas/rate-limit.schema");
|
15
15
|
class MongoStorage {
|
16
|
-
//DEFAULT DB URI VERRIRSEK PATLICAZ GİBİ AMA BAKARIZ, AZ KÖTÜ🤨
|
17
|
-
//connect-mongo kütüphanesini kullanarak yapsak?
|
18
16
|
constructor(mongoDbUrl = "mongodb://127.0.0.1:27017") {
|
19
17
|
this.mongoDbUrl = mongoDbUrl;
|
20
18
|
mongoose_1.default
|
package/package.json
CHANGED
@@ -1,27 +1,36 @@
|
|
1
|
-
{
|
2
|
-
"name": "@canmertinyo/rate-limit-express",
|
3
|
-
"description": "A simple rate-limiting middleware for Express.js",
|
4
|
-
"version": "1.3.
|
5
|
-
"main": "dist/index.js",
|
6
|
-
"license": "MIT",
|
7
|
-
"types": "dist/index.d.ts",
|
8
|
-
"repository": {
|
9
|
-
"type": "git",
|
10
|
-
"url": "https://github.com/c4nzin/rate-limiter-express"
|
11
|
-
},
|
12
|
-
"scripts": {
|
13
|
-
"build": "tsc"
|
14
|
-
},
|
15
|
-
"keywords": [
|
16
|
-
"
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
"
|
21
|
-
"
|
22
|
-
"
|
23
|
-
"
|
24
|
-
"
|
25
|
-
"
|
26
|
-
|
27
|
-
|
1
|
+
{
|
2
|
+
"name": "@canmertinyo/rate-limit-express",
|
3
|
+
"description": "A simple rate-limiting middleware for Express.js with support for in-memory, Redis, and MongoDB storage",
|
4
|
+
"version": "1.3.9",
|
5
|
+
"main": "dist/index.js",
|
6
|
+
"license": "MIT",
|
7
|
+
"types": "dist/index.d.ts",
|
8
|
+
"repository": {
|
9
|
+
"type": "git",
|
10
|
+
"url": "https://github.com/c4nzin/rate-limiter-express"
|
11
|
+
},
|
12
|
+
"scripts": {
|
13
|
+
"build": "tsc"
|
14
|
+
},
|
15
|
+
"keywords": [
|
16
|
+
"rate-limiter",
|
17
|
+
"express",
|
18
|
+
"middleware",
|
19
|
+
"redis",
|
20
|
+
"mongodb",
|
21
|
+
"in-memory",
|
22
|
+
"rate-limit-express",
|
23
|
+
"api-rate-limiting",
|
24
|
+
"express-middleware",
|
25
|
+
"nodejs"
|
26
|
+
],
|
27
|
+
"author": "c4nzin",
|
28
|
+
"devDependencies": {
|
29
|
+
"@types/express": "^5.0.0",
|
30
|
+
"@types/mongoose": "^5.11.97",
|
31
|
+
"ioredis": "^5.4.1",
|
32
|
+
"lerna": "^8.1.9",
|
33
|
+
"mongoose": "^8.8.3",
|
34
|
+
"typescript": "^5.7.2"
|
35
|
+
}
|
36
|
+
}
|