Redis adaptor for node-rate-limiter
Redis 2.6.0+ (lua scripting, pexpire, pttl support)
$ npm install node-rate-limiter-redis
const NodeRateLimiter = require('node-rate-limiter');
const adaptor = new RedisAdaptor({
client: redisClient, // instance of redis client [redis.createClient()]
timeout: 100 // timeout for reset/get methods call [NodeRateLimiter.defaults.timeout]
});
const nodeRateLimiter = new NodeRateLimiter(adaptor);
P.S. please, read node-rate-limiter README file for complete usage guide
You can benchmark performance and compare results with node-ratelimiter
$ ./bin/benchmark.sh
> .\bin\benchmark.cmd