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.3.7 to 2.3.8

6

lib/RateLimiterMemory.js

@@ -51,3 +51,3 @@ const RateLimiterAbstract = require('./RateLimiterAbstract');

const res = this._memoryStorage.incrby(rlKey, points, secDuration);
res.remainingPoints = this.points - res.consumedPoints;
res.remainingPoints = Math.max(this.points - res.consumedPoints, 0);
resolve(res);

@@ -62,3 +62,3 @@ });

const res = this._memoryStorage.incrby(rlKey, -points, secDuration);
res.remainingPoints = this.points - res.consumedPoints;
res.remainingPoints = Math.max(this.points - res.consumedPoints, 0);
resolve(res);

@@ -96,3 +96,3 @@ });

if (res !== null) {
res.remainingPoints = this.points - res.consumedPoints;
res.remainingPoints = Math.max(this.points - res.consumedPoints, 0);
}

@@ -99,0 +99,0 @@

{
"name": "rate-limiter-flexible",
"version": "2.3.7",
"version": "2.3.8",
"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",

@@ -45,2 +45,4 @@ [![Coverage Status](https://coveralls.io/repos/animir/node-rate-limiter-flexible/badge.svg?branch=master)](https://coveralls.io/r/animir/node-rate-limiter-flexible?branch=master)

Points can be consumed by IP address, user ID, authorisation token, API route or any other string.
```javascript

@@ -47,0 +49,0 @@ const opts = {

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