node-rate-limiter-redis
v1.0.1
Published
Radis Adaptor for Node rate limiter
Downloads
3
Maintainers
Readme
node-rate-limiter-redis
Redis adaptor for node-rate-limiter
Requirements
Redis 2.6.0+ (lua scripting, pexpire, pttl support)
Install
$ npm install node-rate-limiter-redis
Usage
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
Benchmark
You can benchmark performance and compare results with node-ratelimiter
Linux/MacOS
$ ./bin/benchmark.sh
Windows
> .\bin\benchmark.cmd