rate-limiter-flexible
Advanced tools
Comparing version 2.1.9 to 2.1.10
@@ -45,3 +45,5 @@ const Record = require('./Record'); | ||
}, durationMs); | ||
this._storage[key].timeoutId.unref(); | ||
if (this._storage[key].timeoutId.unref) { | ||
this._storage[key].timeoutId.unref(); | ||
} | ||
} | ||
@@ -48,0 +50,0 @@ |
{ | ||
"name": "rate-limiter-flexible", | ||
"version": "2.1.9", | ||
"version": "2.1.10", | ||
"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", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "./node_modules/istanbul/lib/cli.js cover ./node_modules/.bin/_mocha --recursive", | ||
"test": "istanbul -v cover -- _mocha --recursive", | ||
"debug-test": "mocha --inspect-brk lib/**/**.test.js", | ||
"coveralls": "cat ./coverage/lcov.info | node node_modules/.bin/coveralls", | ||
"eslint": "node_modules/eslint/bin/eslint.js --quiet lib/**/**.js test/**/**.js", | ||
"eslint-fix": "node_modules/eslint/bin/eslint.js --fix lib/**/**.js test/**/**.js" | ||
"coveralls": "cat ./coverage/lcov.info | coveralls", | ||
"eslint": "eslint --quiet lib/**/**.js test/**/**.js", | ||
"eslint-fix": "eslint --fix lib/**/**.js test/**/**.js" | ||
}, | ||
@@ -13,0 +13,0 @@ "repository": { |
@@ -219,6 +219,7 @@ [![Build Status](https://travis-ci.org/animir/node-rate-limiter-flexible.png)](https://travis-ci.org/animir/node-rate-limiter-flexible) | ||
Any new limiter with storage have to be extended from `RateLimiterStoreAbstract`. | ||
It has to implement at least 4 methods: | ||
It has to implement 4 methods: | ||
* `_getRateLimiterRes` parses raw data from store to `RateLimiterRes` object. | ||
* `_upsert` inserts or updates limits data by key and returns raw data. | ||
* `_get` returns raw data by key. | ||
* `_upsert` must be atomic. it inserts or updates value by key and returns raw data. it must support `forceExpire` mode | ||
to overwrite key expiration time. | ||
* `_get` returns raw data by key or `null` if there is no key. | ||
* `_delete` deletes all key related data and returns `true` on deleted, `false` if key is not found. | ||
@@ -225,0 +226,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
110387
3004
229