Socket
Socket
Sign inDemoInstall

rate-limit-redis

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rate-limit-redis - npm Package Compare versions

Comparing version 1.4.0 to 1.5.0

5

lib/redis-store.js

@@ -8,3 +8,4 @@ 'use strict';

expiry: 60, // default expiry is one minute
prefix: "rl:"
prefix: "rl:",
resetExpiryOnChange: false
});

@@ -19,3 +20,3 @@

// if this is new or has no expiry
if (replies[0] === 1 || replies[1] === -1) {
if (options.resetExpiryOnChange || replies[0] === 1 || replies[1] === -1) {
// then expire it after the timeout

@@ -22,0 +23,0 @@ options.client.pexpire(rdskey, expiryMs);

2

package.json
{
"name": "rate-limit-redis",
"version": "1.4.0",
"version": "1.5.0",
"description": "Provides a Redis store for the express-rate-limit RateLimit middleware.",

@@ -5,0 +5,0 @@ "main": "lib/redis-store.js",

@@ -37,2 +37,3 @@ # Rate Limit Redis

* **expiry**: seconds - how long each rate limiting window exists for. Defaults to `60`.
* **resetExpiryOnChange**: boolean - if the expiry time should be reset every time a key is incremented/decremented. This means that when the limit is reached and the user is given a 429 response, the rate limit window is extended. Defaults to `false`.
* **prefix**: string - prefix to add to entries in Redis. Defaults to `rl:`.

@@ -39,0 +40,0 @@ * **client**: [Redis Client](https://github.com/NodeRedis/node_redis) or [ioredis Client](https://github.com/luin/ioredis)- A Redis Client to use. Defaults to `require('redis').createClient();`.

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