1.0.0 • Published 3 years ago

js-rate-limiter v1.0.0

Weekly downloads
2
License
ISC
Repository
-
Last release
3 years ago

SimpleRateLimiter

super simple Requests RateLimiter integrated with lru cache package.

 
const {RateLimiterSingleton} = require('./dist/index');


//SetRateLimitOptions(timelimit, maximumRequestInTimeLimit);
RateLimiterSingleton.SetRateLimitOptions(4000, 2);

//ThrowLimitExceptionIfNecessary('unique identifier for specific user')
RateLimiterSingleton.GetInstance().ThrowLimitExceptionIfNecessary("2");