# @join-com/request-limit

> Limits number of function call per time frame

Latest version **1.0.0** (published 2018-12-19) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @join-com/request-limit
pnpm add @join-com/request-limit
yarn add @join-com/request-limit
bun add @join-com/request-limit
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2018-12-19 |
| First published | 2018-12-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | JOIN team |
| Maintainers | kirpichenkoo, favorit13, adam187, max.kitsch, join-dev, ant.ver |
| Keywords | request, limit |

## Links

- npm: https://www.npmjs.com/package/@join-com/request-limit
- Repository: https://github.com/join-com/request-limit
- Homepage: https://github.com/join-com/request-limit#readme
- Issues: https://github.com/join-com/request-limit/issues
- npm.io page: https://npm.io/package/@join-com/request-limit

## Alternatives

- [promise-throttle](https://npm.io/package/promise-throttle.md) — 44.2K weekly downloads
- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2018-12-19

## README

## request-limit

Limits number of executed requests made per time frame

### Usage
```ts
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 }
)
```

---
_Source: https://npm.io/package/@join-com/request-limit · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
