{"repo":"Losant/redis-gcra","free":true,"listed":false,"github":"https://github.com/Losant/redis-gcra","clone":"git clone https://github.com/Losant/redis-gcra.git","description":"Rate limiting based on Generic Cell Rate Algorithm","language":"JavaScript","stars":54,"topics":["gcra","redis","node","throttle","rate-limiter"],"license":"MIT","category":"databases-storage","readme_excerpt":"Node Redis GCRA Library This module is an implementation of GCRA for rate limiting based on Redis. Installation API Documentation Initializer Instance Functions limit peek reset Node-redis usage Example Inspiration License Installation API Documentation RedisGCRA({ redis, keyPrefix, burst, rate, period, cost }) The redis-gcra module exposes a single function, which returns a limiter instance when called. It takes the following options: Option Type Default Description :----- :--- ------- :---------- redis ioredis or node-redis instance Required. The Redis client to be used. ( If you use node-redis, additional setup work is required; see below. You may also use a Redis-client-like wrapper that exposes the defineCommand method and the Redis del method.) keyPrefix String A prefix for any keys that this limiter instance tries to create/access. burst Number 60 The default burst value for this limiter instance. If provided, must be a number greater than or equal to 1. rate Number 1 The default rate value for this limiter instance. If provided, must be a number greater than or equal to 1. period Number 1000 The default period value for this limiter instance (milliseconds). If provided, must be a number greater than or equal to 1. cost Number 1 The default cost value for for this limiter instance. If provided, must be a number greater than or equal to 0. Instance Functions limit({ key, burst, rate, period, cost }) In order to perform rate limiting, you need to call the limit method. T","default_branch":null,"files":null,"tree":[],"storefront":"/r/Losant","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Losant/redis-gcra/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}