rate-limiter-flexible 2.3.4 → 2.3.5

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
@@ -93,10 +93,13 @@ const headers = {
93
93
  * 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
94
  * useful `get`, `set`, `block`, `delete`, `penalty` and `reward` methods
95
95
 
96
- ### Middlewares and plugins
96
+ ### Middlewares, plugins and other packages
97
97
  * [Express middleware](https://github.com/animir/node-rate-limiter-flexible/wiki/Express-Middleware)
98
98
  * [Koa middleware](https://github.com/animir/node-rate-limiter-flexible/wiki/Koa-Middleware)
99
99
  * [Hapi plugin](https://github.com/animir/node-rate-limiter-flexible/wiki/Hapi-plugin)
100
+ * GraphQL [graphql-rate-limit-directive](https://www.npmjs.com/package/graphql-rate-limit-directive)
101
+ * NestJS try [nestjs-rate-limiter](https://www.npmjs.com/package/nestjs-rate-limiter)
102
+ * Fastify based NestJS app try [nestjs-fastify-rate-limiter](https://www.npmjs.com/package/nestjs-fastify-rate-limiter)
100
103
 
101
104
  Some copy/paste examples on Wiki:
102
105
  * [Minimal protection against password brute-force](https://github.com/animir/node-rate-limiter-flexible/wiki/Overall-example#minimal-protection-against-password-brute-force)
@@ -51,7 +51,7 @@ class RateLimiterQueueInternal {
51
51
  getTokensRemaining() {
52
52
  return this._limiterFlexible.get(this._key)
53
53
  .then((rlRes) => {
54
- return rlRes.remainingPoints
54
+ return rlRes !== null ? rlRes.remainingPoints : this._limiterFlexible.points;
55
55
  })
56
56
  }
57
57
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rate-limiter-flexible",
3
- "version": "2.3.4",
3
+ "version": "2.3.5",
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": {