# @nielse63/debounce

> Lightweight debounce function for node

Latest version **0.1.4** (published 2018-08-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install @nielse63/debounce
pnpm add @nielse63/debounce
yarn add @nielse63/debounce
bun add @nielse63/debounce
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2018-08-22 |
| First published | 2018-07-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Erik Nielsen |
| Maintainers | nielse63 |
| Keywords | debounce, utilities |

## Links

- npm: https://www.npmjs.com/package/@nielse63/debounce
- Repository: https://github.com/nielse63/nielse63
- Homepage: https://github.com/nielse63/nielse63/tree/master/packages/debounce
- Issues: https://github.com/nielse63/nielse63/issues
- npm.io page: https://npm.io/package/@nielse63/debounce

## Recent versions

- 0.1.4 (latest) — 2018-08-22
- 0.2.0-alpha.7032d0c (canary) — 2018-07-31
- 0.1.3 — 2018-07-31
- 0.1.2 — 2018-07-31
- 0.1.1 — 2018-07-31
- 0.0.3 — 2018-07-31
- 0.1.0-alpha.801675f — 2018-07-31
- 0.0.2 — 2018-07-29

## README

# `@nielse63/debounce`

> Lightweight debounce function for node

## Installation

Install with Yarn or npm

```bash
yarn add --dev @nielse63/debounce
npm install --save-dev @nielse63/debounce
```

## Usage

```js
const debounce = require('@nielse63/debounce');

const fn = () => {
  // some expensive function...
};

debounce(fn); // executed after 250ms
```

## API

### `debounce(callback[, delay, immediate])`

<!-- markdownlint-disable MD013 -->
| Name      | Type     | Description                                    | Default   |
|:----------|:---------|:-----------------------------------------------|:----------|
| callback  | Function | Callback to execute after `delay`              | undefined |
| delay     | Number   | Delay, in ms, before executing `callback`      | 250       |
| immediate | Boolean  | Whether or not to run the function immediately | false     |
<!-- markdownlint-enable MD013 -->

### Return Value

`Function` - The wrapper to execute the callback

## Contributing

### Development Setup

This project uses a monorepo setup that requires using Yarn because it
relies on
[Yarn workspaces](https://yarnpkg.com/blog/2017/08/02/introducing-workspaces/).
Clone the repo and install the dependencies:

```bash
git clone https://github.com/nielse63/nielse63.git
cd nielse63
yarn
```

## License

[MIT](https://github.com/nielse63/nielse63/blob/master/LICENSE) © [Erik Nielsen](https://312development.com)

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