Skip to content

debitoor/node-rate-limiter-redis

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 71.8%
  • Batchfile 16.2%
  • Shell 7.7%
  • Lua 4.3%