Socket
Socket
Sign inDemoInstall

rate-limiter-flexible

Package Overview
Dependencies
0
Maintainers
1
Versions
163
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.3.0 to 1.3.1

2

lib/RateLimiterAbstract.js

@@ -85,3 +85,3 @@ module.exports = class RateLimiterAbstract {

_getKeySecDuration(options = {}) {
return options && options.customDuration
return options && options.customDuration >= 0
? options.customDuration

@@ -88,0 +88,0 @@ : this.duration;

{
"name": "rate-limiter-flexible",
"version": "1.3.0",
"version": "1.3.1",
"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,0 +5,0 @@ "main": "index.js",

@@ -14,3 +14,3 @@ [![Build Status](https://travis-ci.org/animir/node-rate-limiter-flexible.png)](https://travis-ci.org/animir/node-rate-limiter-flexible)

**rate-limiter-flexible** limits number of actions by key and protects from DDoS and brute force attacks at any scale.
**rate-limiter-flexible** counts and limits number of actions by key and protects from DDoS and brute force attacks at any scale.

@@ -137,3 +137,5 @@ It works with _Redis_, process _Memory_, _Cluster_ or _PM2_, _Memcached_, _MongoDB_, _MySQL_, _PostgreSQL_ and allows to control requests rate in single process or distributed environment.

Number of seconds before consumed points are reset
Number of seconds before consumed points are reset.
Never reset points, if `duration` is set to 0.

@@ -171,2 +173,3 @@ * **storeClient**

* [get(key)](https://github.com/animir/node-rate-limiter-flexible/wiki/API-methods#ratelimitergetkey) Get `RateLimiterRes` or `null`.
* [set(key, points, secDuration)](https://github.com/animir/node-rate-limiter-flexible/wiki/API-methods#ratelimitersetkey-points-secduration) Set points by key.
* [block(key, secDuration)](https://github.com/animir/node-rate-limiter-flexible/wiki/API-methods#ratelimiterblockkey-secduration) Block key for `secDuration` seconds.

@@ -173,0 +176,0 @@ * [delete(key)](https://github.com/animir/node-rate-limiter-flexible/wiki/API-methods#ratelimiterdeletekey) Reset consumed points.

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc