# @tcort/leakybucket

> simple and efficient leaky bucket implementation

Latest version **1.0.2** (published 2021-04-02) · ISC license · 0 weekly downloads

## Install

```sh
npm install @tcort/leakybucket
pnpm add @tcort/leakybucket
yarn add @tcort/leakybucket
bun add @tcort/leakybucket
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2021-04-02 |
| First published | 2021-04-02 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Thomas Cort |
| Maintainers | tcort |
| Keywords | leaky, bucket, rate, limit |

## Links

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

## Alternatives

- [@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
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 1.0.2 (latest) — 2021-04-02

## README

# leakybucket

simple and efficient leaky bucket implementation.

## Example

This leaky bucket allows up to 2 drips in a 5 second window.

```
'use strict';

const LeakyBucket = require('leakybucket');

                               /* capacity */ /* window     */
const bucket = new LeakyBucket(      2       ,   5000 /* ms */);

setInterval(() => bucket.drip(), 1000); // simulate hits every 1 second

// throws a LEAKYBUCKET_FULL error after 3 seconds
```

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