node-rate-limiter-redis

1.0.1 • Public • Published

node-rate-limiter-redis Build Status

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

License

MIT

Package Sidebar

Install

npm i node-rate-limiter-redis

Weekly Downloads

3

Version

1.0.1

License

MIT

Unpacked Size

16.3 kB

Total Files

15

Last publish

Collaborators

  • mujichok