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 0.16.6 to 0.17.0

lib/RLWrapperBlackAndWhite.js

2

package.json
{
"name": "rate-limiter-flexible",
"version": "0.16.6",
"version": "0.17.0",
"description": "Flexible API rate limiter backed by Redis for distributed node.js applications",

@@ -5,0 +5,0 @@ "main": "index.js",

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

**Friendly.** No matter which node package you prefer: `redis` or `ioredix`, `sequelize` or `knex`, native driver or `mongoose`. It friends with all.
**Friendly.** No matter which node package you prefer: `redis` or `ioredis`, `sequelize` or `knex`, native driver or `mongoose`. It works with all of them.

@@ -69,4 +69,5 @@ It works in process

* [RateLimiterCluster](https://github.com/animir/node-rate-limiter-flexible/wiki/Cluster)
* [RateLimiterMemory](#ratelimitermemory)
* [RateLimiterMemory](https://github.com/animir/node-rate-limiter-flexible/wiki/Memory)
* [RateLimiterUnion](https://github.com/animir/node-rate-limiter-flexible/wiki/RateLimiterUnion) Combine 2 or more limiters to act as single
* [RLWrapperBlackAndWhite](https://github.com/animir/node-rate-limiter-flexible/wiki/BlackAndWhite) Black and White lists
* [Express middleware](#express-middleware)

@@ -325,20 +326,2 @@ * [Koa middleware](#koa-middleware)

### RateLimiterMemory
It manages limits in **current process memory**, so keep it in mind when use it in cluster
```javascript
const rateLimiter = new RateLimiterMemory(
{
keyPrefix: 'rlflx',
points: 1, // 1 is fair if you have 5 workers and 1 cluster, all workers will limit it to 5 in sum
duration: 5,
execEvenly: false,
});
// Usage is the same as for RateLimiterRedis
// Except: it never rejects Promise with Error
```
### Express middleware

@@ -345,0 +328,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