rate-limiter-flexible 2.3.4 → 2.3.7
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
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
[](https://travis-ci.org/animir/node-rate-limiter-flexible)
|
|
2
1
|
[](https://coveralls.io/r/animir/node-rate-limiter-flexible?branch=master)
|
|
3
2
|
[](https://www.npmjs.com/package/rate-limiter-flexible)
|
|
4
3
|

|
|
@@ -93,10 +92,13 @@ const headers = {
|
|
|
93
92
|
* works in Cluster or PM2 without additional software [See RateLimiterCluster benchmark and detailed description here](https://github.com/animir/node-rate-limiter-flexible/wiki/Cluster)
|
|
94
93
|
* useful `get`, `set`, `block`, `delete`, `penalty` and `reward` methods
|
|
95
94
|
|
|
96
|
-
### Middlewares and
|
|
95
|
+
### Middlewares, plugins and other packages
|
|
97
96
|
* [Express middleware](https://github.com/animir/node-rate-limiter-flexible/wiki/Express-Middleware)
|
|
98
97
|
* [Koa middleware](https://github.com/animir/node-rate-limiter-flexible/wiki/Koa-Middleware)
|
|
99
98
|
* [Hapi plugin](https://github.com/animir/node-rate-limiter-flexible/wiki/Hapi-plugin)
|
|
99
|
+
* GraphQL [graphql-rate-limit-directive](https://www.npmjs.com/package/graphql-rate-limit-directive)
|
|
100
|
+
* NestJS try [nestjs-rate-limiter](https://www.npmjs.com/package/nestjs-rate-limiter)
|
|
101
|
+
* Fastify based NestJS app try [nestjs-fastify-rate-limiter](https://www.npmjs.com/package/nestjs-fastify-rate-limiter)
|
|
100
102
|
|
|
101
103
|
Some copy/paste examples on Wiki:
|
|
102
104
|
* [Minimal protection against password brute-force](https://github.com/animir/node-rate-limiter-flexible/wiki/Overall-example#minimal-protection-against-password-brute-force)
|
package/lib/RateLimiterQueue.js
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -237,6 +237,10 @@ interface IRateLimiterStoreOptions extends IRateLimiterOptions {
|
|
|
237
237
|
tableCreated?: boolean;
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
+
interface IRateLimiterStoreNoAutoExpiryOptions extends IRateLimiterStoreOptions {
|
|
241
|
+
clearExpiredByTimeout?: boolean;
|
|
242
|
+
}
|
|
243
|
+
|
|
240
244
|
interface IRateLimiterMongoOptions extends IRateLimiterStoreOptions {
|
|
241
245
|
indexKeyPrefix?: {
|
|
242
246
|
[key: string]: any;
|
|
@@ -326,11 +330,11 @@ export class RateLimiterMongo extends RateLimiterStoreAbstract {
|
|
|
326
330
|
}
|
|
327
331
|
|
|
328
332
|
export class RateLimiterMySQL extends RateLimiterStoreAbstract {
|
|
329
|
-
constructor(opts:
|
|
333
|
+
constructor(opts: IRateLimiterStoreNoAutoExpiryOptions, cb?: ICallbackReady);
|
|
330
334
|
}
|
|
331
335
|
|
|
332
336
|
export class RateLimiterPostgres extends RateLimiterStoreAbstract {
|
|
333
|
-
constructor(opts:
|
|
337
|
+
constructor(opts: IRateLimiterStoreNoAutoExpiryOptions, cb?: ICallbackReady);
|
|
334
338
|
}
|
|
335
339
|
|
|
336
340
|
export class RateLimiterMemcache extends RateLimiterStoreAbstract {}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rate-limiter-flexible",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.7",
|
|
4
4
|
"description": "Node.js rate limiter by key and protection from DDoS and Brute-Force attacks in process Memory, Redis, MongoDb, Memcached, MySQL, PostgreSQL, Cluster or PM",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|