js-rate-limiter

1.0.0 • Public • Published

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");

Readme

Keywords

none

Package Sidebar

Install

npm i js-rate-limiter

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

2.34 kB

Total Files

8

Last publish

Collaborators

  • carmigalc