Socket
Socket
Sign inDemoInstall

rate-limiter-flexible

Package Overview
Dependencies
Maintainers
1
Versions
163
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rate-limiter-flexible - npm Package Compare versions

Comparing version 2.1.9 to 2.1.10

4

lib/component/MemoryStorage/MemoryStorage.js

@@ -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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc