<commit_before># node-rate-limiter-redis [![Build Status](https://travis-ci.org/mujichOk/node-rate-limiter-redis.svg?branch=master)](https://travis-ci.org/mujichOk/node-rate-limiter-redis)

Redis adaptor for [node-rate-limiter](https://github.com/mujichOk/node-rate-limiter)

# Requirements

Redis 2.6.0+ ([lua scripting](https://redis.io/commands/evalsha), [pexpire](https://redis.io/commands/pexpire), [pttl](https://redis.io/commands/pttl) support)

# Usage
```js
    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](https://github.com/mujichOk/node-rate-limiter) README file for complete usage guide 

# Benchmark

You can run benchmark performance and compare results with [node-ratelimiter](https://github.com/tj/node-ratelimiter)

#### Linux/MacOS
```<commit_msg>text adjust<commit_after># node-rate-limiter-redis [![Build Status](https://travis-ci.org/mujichOk/node-rate-limiter-redis.svg?branch=master)](https://travis-ci.org/mujichOk/node-rate-limiter-redis)

Redis adaptor for [node-rate-limiter](https://github.com/mujichOk/node-rate-limiter)

# Requirements

Redis 2.6.0+ ([lua scripting](https://redis.io/commands/evalsha), [pexpire](https://redis.io/commands/pexpire), [pttl](https://redis.io/commands/pttl) support)

# Usage
```js
    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](https://github.com/mujichOk/node-rate-limiter) README file for complete usage guide 

# Benchmark

You can benchmark performance and compare results with [node-ratelimiter](https://github.com/tj/node-ratelimiter)

#### Linux/MacOS
```
{'fraction_non_alphanumeric': 0.15433212996389892, 'fraction_numerical': 0.005415162454873646, 'mean_word_length': 4.291169451073985, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 16, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4273742', 'n_tokens_mistral': 775, 'n_tokens_neox': 750, 'n_words': 132}