# throttleit

> Throttle a function to limit its execution rate

Latest version **3.0.0** (published 2026-07-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install throttleit
pnpm add throttleit
yarn add throttleit
bun add throttleit
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2026-07-11 |
| First published | 2013-03-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=22 |
| Dependencies | 0 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 108 |
| Maintainers | sindresorhus |
| Keywords | throttle, rate, limit, limited, rate-limit, ratelimit, throttling, optimization, performance, function, execution, interval, batch |

## Links

- npm: https://www.npmjs.com/package/throttleit
- Repository: https://github.com/sindresorhus/throttleit
- Homepage: https://github.com/sindresorhus/throttleit#readme
- Issues: https://github.com/sindresorhus/throttleit/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/throttleit

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 3.0.0 (latest) — 2026-07-11
- 2.1.0 — 2024-06-21
- 2.0.0 — 2023-11-17
- 1.0.1 — 2023-11-17
- 1.0.0 — 2015-02-27
- 0.0.2 — 2013-03-26
- 0.0.1 — 2013-03-26

## README

# throttleit

> Throttle a function to limit its execution rate

## Install

```sh
npm install throttleit
```

## Usage

```js
import throttle from 'throttleit';

// Throttling a function that processes data.
function processData(data) {
	console.log('Processing:', data);

	// Add data processing logic here.
}

// Throttle the `processData` function to be called at most once every 3 seconds.
const throttledProcessData = throttle(processData, 3000);

// Simulate calling the function multiple times with different data.
throttledProcessData('Data 1');
throttledProcessData('Data 2');
throttledProcessData('Data 3');
```

## API

### throttle(function, wait)

Creates a throttled function that limits calls to the original function to at most once every `wait` milliseconds. It guarantees execution after the final invocation and maintains the last context (`this`) and arguments.

The throttled function returns the result of the most recent execution of the original function. When a call is deferred, it returns the result from the previous execution (or `undefined` if it has not executed yet).

#### function

Type: `Function`

The function to be throttled.

#### wait

Type: `number`

The number of milliseconds to throttle invocations to.

Must be a non-negative finite number.

## Related

- [p-throttle](https://github.com/sindresorhus/p-throttle) - Throttle async functions
- [debounce](https://github.com/sindresorhus/debounce) - Delay function calls until a set time elapses after the last invocation

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