This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@join-com/request-limit
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

request-limit

Limits number of executed requests made per time frame

Usage

import { RequestLimit } from '@join-com/request-limit'

const REQUESTS_LIMIT = 5 // Max number of requests can be executed during specific time frame
const REQUESTS_LIMIT_TIMEOUT = 10000 // Time frame in ms for which number of requests can be executed is limited
const RETRY_TIMEOUT = 1000 // Timeout in ms after which not executed requests will be re-scheduled

// Create an instance
const requestLimit = new RequestLimit(REQUESTS_LIMIT, REQUESTS_LIMIT_TIMEOUT, RETRY_TIMEOUT)

// Function will be limited to 5 requests per 10 seconds
const request = requestLimit.setLimit(
  () => { // Do something }
)

Readme

Keywords

Package Sidebar

Install

npm i @join-com/request-limit

Weekly Downloads

4

Version

1.0.0

License

MIT

Unpacked Size

5.91 kB

Total Files

5

Last publish

Collaborators

  • join-dev
  • adam187
  • kirpichenkoo
  • tcichowicz
  • mayada
  • jakubspringer
  • readonly-user-join-com
  • 12m3r
  • kevincharecki
  • vitalii.pasiuta
  • ashraaf.ateef
  • yosri.mimouna
  • szymonszklarskijoin
  • alaa-awad
  • dlljoin
  • michal.baran
  • ddadonjoin
  • shankaranloganathan
  • michal.adamski.join
  • eugenetaran
  • maciejlaszkiewicz
  • sosodope
  • kamill-szymanski-join
  • elgayar
  • roman_dronov
  • jo-fr
  • gwozniak
  • reza-join
  • mohammed.ameen
  • naoisegolden
  • damian.join