js-rate-limiter
v1.0.0
Published
simple rate limiter
Downloads
7
Readme
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");