rate-limiter-flexible
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -11,2 +11,3 @@ const RateLimiterRedis = require('./lib/RateLimiterRedis'); | ||
const RateLimiterQueue = require('./lib/RateLimiterQueue'); | ||
const BurstyRateLimiter = require('./lib/BurstyRateLimiter'); | ||
const RateLimiterRes = require('./lib/RateLimiterRes'); | ||
@@ -27,3 +28,4 @@ | ||
RateLimiterQueue, | ||
BurstyRateLimiter, | ||
RateLimiterRes, | ||
}; | ||
}; |
@@ -15,3 +15,3 @@ export interface IRateLimiterRes { | ||
readonly isFirstInDuration: boolean; | ||
toString(): string; | ||
@@ -163,1 +163,7 @@ toJSON(): { | ||
} | ||
export class BurstyRateLimiter { | ||
constructor(rateLimiter: RateLimiterAbstract, burstLimiter: RateLimiterAbstract) | ||
consume(key: string | number, pointsToConsume?: number, options?: IRateLimiterMongoFunctionOptions): Promise<RateLimiterRes>; | ||
} |
{ | ||
"name": "rate-limiter-flexible", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "Node.js rate limiter by key and protection from DDoS and Brute-Force attacks in process Memory, Redis, MongoDb, Memcached, MySQL, PostgreSQL, Cluster or PM", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -20,2 +20,4 @@ [![Build Status](https://travis-ci.org/animir/node-rate-limiter-flexible.png)](https://travis-ci.org/animir/node-rate-limiter-flexible) | ||
**Traffic bursts.** Replace Token Bucket with [BurstyRateLimiter](https://github.com/animir/node-rate-limiter-flexible/wiki/BurstyRateLimiter) | ||
**Fast.** Average request takes `0.7ms` in Cluster and `2.5ms` in Distributed application. See [benchmarks](https://github.com/animir/node-rate-limiter-flexible#benchmark). | ||
@@ -84,7 +86,7 @@ | ||
* TypeScript declaration bundled | ||
* in-memory Block Strategy against really powerful DDoS attacks (like 100k requests per sec) [Read about it and benchmarking here](https://github.com/animir/node-rate-limiter-flexible/wiki/In-memory-Block-Strategy) | ||
* allow traffic burst with [BurstyRateLimiter](https://github.com/animir/node-rate-limiter-flexible/wiki/BurstyRateLimiter) | ||
* Block Strategy against really powerful DDoS attacks (like 100k requests per sec) [Read about it and benchmarking here](https://github.com/animir/node-rate-limiter-flexible/wiki/In-memory-Block-Strategy) | ||
* Insurance Strategy as emergency solution if database / store is down [Read about Insurance Strategy here](https://github.com/animir/node-rate-limiter-flexible/wiki/Insurance-Strategy) | ||
* works in Cluster or PM2 without additional software [See RateLimiterCluster benchmark and detailed description here](https://github.com/animir/node-rate-limiter-flexible/wiki/Cluster) | ||
* shape traffic with Leaky Bucket analogy [Read about Leaky Bucket analogy](https://github.com/animir/node-rate-limiter-flexible/wiki/Leaky-Bucket-Analogy-execute-actions-evenly) | ||
* useful `get`, `block`, `delete`, `penalty` and `reward` methods | ||
* useful `get`, `set`, `block`, `delete`, `penalty` and `reward` methods | ||
@@ -115,2 +117,3 @@ ### Middlewares and plugins | ||
* [API methods](https://github.com/animir/node-rate-limiter-flexible/wiki/API-methods) | ||
* [BurstyRateLimiter](https://github.com/animir/node-rate-limiter-flexible/wiki/BurstyRateLimiter) Traffic burst support | ||
* [RateLimiterRedis](https://github.com/animir/node-rate-limiter-flexible/wiki/Redis) | ||
@@ -117,0 +120,0 @@ * [RateLimiterMemcache](https://github.com/animir/node-rate-limiter-flexible/wiki/Memcache) |
106165
27
2879
217