Skip to content

HurSungYun/throttle-checker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

throttle-checker

simple throttle checker for Typescript

import { ThrottleChecker } from 'throttle-checker';

function throttleCallback() {
  console.log('throttled!');
}

const checker = new ThrottleChecker({
  period: 10 * 60, // sec
  throttle_time: 10 * 60, // sec
  threshold: 5,
}, throttleCallback);

for (let i = 0; i < 10; i++) {
  if (checker.check()) {
    console.log('filtered: ' + i);
  }
}

About

super simple throttle checker

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published