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.5.0 to 1.6.0

.editorconfig

7

lib/redis-store.js

@@ -22,2 +22,5 @@ 'use strict';

options.client.pexpire(rdskey, expiryMs);
return expiryMs;
} else {
return replies[1];
}

@@ -51,5 +54,5 @@ };

replies = processReplies(replies);
setExpire(replies, rdskey);
var ttl = setExpire(replies, rdskey);
cb(null, replies[0]);
cb(null, replies[0], ttl > 0 ? new Date(new Date().getTime() + ttl) : null);
});

@@ -56,0 +59,0 @@ };

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

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

@@ -34,2 +34,18 @@ # Rate Limit Redis

## Connect to UDP Socket
```
var RateLimit = require('express-rate-limit');
var RedisStore = require('rate-limit-redis');
var Redis = require('ioredis');
var client = new Redis('/tmp/redis.sock');
var limiter = new RateLimit({
store: new RedisStore({
client: client,
}),
max: 100, // limit each IP to 100 requests per windowMs
delayMs: 0 // disable delaying - full speed until the max limit is reached
});
```
## Configuration

@@ -36,0 +52,0 @@

Sorry, the diff of this file is not supported yet

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