open-index/open-npm huggingface dataset:
npm package: @lavadrop/attempt
Description: Wraps func in a try...catch.
Author: Jed Mao
Latest version: 1.4.1

# @lavadrop/attempt

[![npm license](http://img.shields.io/npm/l/@lavadrop/attempt.svg)](https://www.npmjs.org/package/@lavadrop/attempt)
[![Travis Build Status](https://img.shields.io/travis/jedmao/lavadrop.svg)](https://travis-ci.org/jedmao/lavadrop)
[![codecov](https://codecov.io/gh/jedmao/lavadrop/branch/master/graph/badge.svg)](https://codecov.io/gh/jedmao/lavadrop)
[![Try @lavadrop/attempt on RunKit](https://badge.runkitcdn.com/@lavadrop/attempt.svg)](https://npm.runkit.com/@lavadrop/attempt)

Part of a [library](../../../../) of zero-dependency npm modules that do just
one thing.

- 100% [TypeScript](http://www.typescriptlang.org/) support.
- It's not a party without [`Lavadrop`](../../../../)!

[![npm](https://nodei.co/npm/@lavadrop/attempt.svg?downloads=true)](https://nodei.co/npm/@lavadrop/attempt/)

min + gzip | 126 bytes

[source](https://github.com/jedmao/lavadrop/blob/master/src/packages/attempt/attempt.ts)

Wraps `func` in a `try...catch`.

## Usage

```ts
import attempt from '@lavadrop/attempt'

function exclaim(message: string) {
return message + '!'
}
attempt(exclaim)('hi')
```

## Parameters

| Name   | Type    | Description           |
| :----- | :------ | :-------------------- |
| `func` | `TFunc` | The function to wrap. |

### Type parameters

| Name      | Constraint                | Default |
| :-------- | :------------------------ | :------ |
| `TFunc`   | `(...args: any[]) => any` |         |
| `TReason` |                           | `Error` |

## Returns

A new wrapper function that, when called, returns a tuple of `[err, success]`.

### Return type

```ts
<TReason = Error>(
	...args: Parameters<TFunc>
) => [TReason | null, (ReturnType<TFunc> | undefined)?]
```
npm package: @lavadrop/camel-case
Description: Converts a string value into camel case.
Author: Jed Mao
Latest version: 0.4.0

# @lavadrop/camel-case

[![npm license](http://img.shields.io/npm/l/@lavadrop/camel-case.svg)](https://www.npmjs.org/package/@lavadrop/camel-case)
[![Travis Build Status](https://img.shields.io/travis/jedmao/lavadrop.svg)](https://travis-ci.org/jedmao/lavadrop)
[![codecov](https://codecov.io/gh/jedmao/lavadrop/branch/master/graph/badge.svg)](https://codecov.io/gh/jedmao/lavadrop)
[![Try @lavadrop/camel-case on RunKit](https://badge.runkitcdn.com/@lavadrop/camel-case.svg)](https://npm.runkit.com/@lavadrop/camel-case)

Part of a [library](../../../../) of zero-dependency npm modules that do just
one thing.

- 100% [TypeScript](http://www.typescriptlang.org/) support.
- It's not a party without [`Lavadrop`](../../../../)!

[![npm](https://nodei.co/npm/@lavadrop/camel-case.svg?downloads=true)](https://nodei.co/npm/@lavadrop/camel-case/)

min + gzip | 224 bytes

[source](https://github.com/jedmao/lavadrop/blob/master/src/packages/camel-case/camelCase.ts)

Converts a string value into [camel case](https://en.wikipedia.org/wiki/Camel_case).

## Usage

```ts
import camelCase from '@lavadrop/camel-case'

camelCase('foo-bar-baz')
// => 'fooBarBaz'
```

## Parameters

| Name    | Type     | Description            |
| :------ | :------- | :--------------------- |
| `value` | `string` | The string to convert. |

## Returns

The camel-cased string.

### Return type

```ts
string
```
npm package: @lavadrop/debounce
Description: Creates a debounced function that delays invoking func until after wait milliseconds have elapsed since the last time the debounced function was invoked.
Author: Jed Mao
Latest version: 3.0.0

# @lavadrop/debounce

[![npm license](http://img.shields.io/npm/l/@lavadrop/debounce.svg)](https://www.npmjs.org/package/@lavadrop/debounce)
[![Travis Build Status](https://img.shields.io/travis/jedmao/lavadrop.svg)](https://travis-ci.org/jedmao/lavadrop)
[![codecov](https://codecov.io/gh/jedmao/lavadrop/branch/master/graph/badge.svg)](https://codecov.io/gh/jedmao/lavadrop)
[![Try @lavadrop/debounce on RunKit](https://badge.runkitcdn.com/@lavadrop/debounce.svg)](https://npm.runkit.com/@lavadrop/debounce)

Part of a [library](../../../../) of zero-dependency npm modules that do just
one thing.

- 100% [TypeScript](http://www.typescriptlang.org/) support.
- It's not a party without [`Lavadrop`](../../../../)!

[![npm](https://nodei.co/npm/@lavadrop/debounce.svg?downloads=true)](https://nodei.co/npm/@lavadrop/debounce/)

min + gzip | 199 bytes

[source](https://github.com/jedmao/lavadrop/blob/master/src/packages/debounce/debounce.ts)

Creates a debounced function that delays invoking `func` until after `wait`
milliseconds have elapsed since the last time the debounced function was invoked.

## Usage

```ts
import debounce from '@lavadrop/debounce'

function calculateLayout() {}
const [debounced, cancel] = debounce(calculateLayout, 100)
window.addEventListener('resize', debounced)
cancel()
```

## Parameters

| Name                    | Type              | Description                                                                                       |
| :---------------------- | :---------------- | :------------------------------------------------------------------------------------------------ |
| `func`                  | `TFunc`           | The function to debounce.                                                                         |
| `wait`                  | `number`          | The number of milliseconds to which invocations are debounced.                                    |
| `{ leading, trailing }` | `DebounceOptions` | Specify invoking on the `leading` or `trailing` edge of the timeout (Default is `trailing=true`). |

### Type parameters

| Name    | Constraint                |
| :------ | :------------------------ |
| `TFunc` | `(...args: any[]) => any` |

## Returns

A new debounced function paired with a cancel function.

### Return type

```ts
[(...args: Parameters<TFunc>) => any, () => void]
```
npm package: @lavadrop/ensure
Description: Ensures value is defined (i.e., neither undefined nor null).
Author: Jed Mao
Latest version: 1.0.0

# @lavadrop/ensure

[![npm license](http://img.shields.io/npm/l/@lavadrop/ensure.svg)](https://www.npmjs.org/package/@lavadrop/ensure)
[![Travis Build Status](https://img.shields.io/travis/jedmao/lavadrop.svg)](https://travis-ci.org/jedmao/lavadrop)
[![codecov](https://codecov.io/gh/jedmao/lavadrop/branch/master/graph/badge.svg)](https://codecov.io/gh/jedmao/lavadrop)
[![Try @lavadrop/ensure on RunKit](https://badge.runkitcdn.com/@lavadrop/ensure.svg)](https://npm.runkit.com/@lavadrop/ensure)

Part of a [library](../../../../) of zero-dependency npm modules that do just
one thing.

- 100% [TypeScript](http://www.typescriptlang.org/) support.
- It's not a party without [`Lavadrop`](../../../../)!

[![npm](https://nodei.co/npm/@lavadrop/ensure.svg?downloads=true)](https://nodei.co/npm/@lavadrop/ensure/)

min + gzip | 139 bytes

[source](https://github.com/jedmao/lavadrop/blob/master/src/packages/ensure/ensure.ts)

Ensures `value` is defined (i.e., neither `undefined` nor `null`).

## Usage

```ts
import ensure from '@lavadrop/ensure'

ensure(42)
// => 42
```

## Parameters

| Name      | Type     | Description |
| :-------- | :------- | :---------- |
| `value`   | `T`      |             |
| `message` | `string` |             |

### Type parameters

| Name |
| :--- |
| `T`  |

## Returns

The original `value`.

### Return type

```ts
NonNullable<T>
```
npm package: @lavadrop/fib
Description: A Fibonacci sequence generator.
Author: Jed Mao
Latest version: 1.0.0

# @lavadrop/fib

[![npm license](http://img.shields.io/npm/l/@lavadrop/fib.svg)](https://www.npmjs.org/package/@lavadrop/fib)
[![Travis Build Status](https://img.shields.io/travis/jedmao/lavadrop.svg)](https://travis-ci.org/jedmao/lavadrop)
[![codecov](https://codecov.io/gh/jedmao/lavadrop/branch/master/graph/badge.svg)](https://codecov.io/gh/jedmao/lavadrop)
[![Try @lavadrop/fib on RunKit](https://badge.runkitcdn.com/@lavadrop/fib.svg)](https://npm.runkit.com/@lavadrop/fib)

Part of a [library](../../../../) of zero-dependency npm modules that do just
one thing.

- 100% [TypeScript](http://www.typescriptlang.org/) support.
- It's not a party without [`Lavadrop`](../../../../)!

[![npm](https://nodei.co/npm/@lavadrop/fib.svg?downloads=true)](https://nodei.co/npm/@lavadrop/fib/)

min + gzip | 99 bytes

[source](https://github.com/jedmao/lavadrop/blob/master/src/packages/fib/fib.ts)

A Fibonacci sequence generator.

## Usage

```ts
import fib from '@lavadrop/fib'

const fibs = fib()
fibs.next() // { done: false, value: 0 }
fibs.next() // { done: false, value: 1 }
fibs.next() // { done: false, value: 1 }
fibs.next().value
// => 2
```

## Parameters

none

## Returns

A Fibonacci sequence iterator.
It never ends, so the result of `next()` will always contain `done: false`.

### Return type

```ts
Generator<number, number, number>
```
npm package: @lavadrop/identity
Description: Returns the first argument it receives and ignores any additional arguments.
Author: Jed Mao
Latest version: 3.0.0

# @lavadrop/identity

[![npm license](http://img.shields.io/npm/l/@lavadrop/identity.svg)](https://www.npmjs.org/package/@lavadrop/identity)
[![Travis Build Status](https://img.shields.io/travis/jedmao/lavadrop.svg)](https://travis-ci.org/jedmao/lavadrop)
[![codecov](https://codecov.io/gh/jedmao/lavadrop/branch/master/graph/badge.svg)](https://codecov.io/gh/jedmao/lavadrop)
[![Try @lavadrop/identity on RunKit](https://badge.runkitcdn.com/@lavadrop/identity.svg)](https://npm.runkit.com/@lavadrop/identity)

Part of a [library](../../../../) of zero-dependency npm modules that do just
one thing.

- 100% [TypeScript](http://www.typescriptlang.org/) support.
- It's not a party without [`Lavadrop`](../../../../)!

[![npm](https://nodei.co/npm/@lavadrop/identity.svg?downloads=true)](https://nodei.co/npm/@lavadrop/identity/)

min + gzip | 62 bytes

[source](https://github.com/jedmao/lavadrop/blob/master/src/packages/identity/identity.ts)

Returns the first argument it receives and ignores any additional arguments.

## Usage

```ts
import identity from '@lavadrop/identity'

const object = { a: 1 }
identity(object) === object
// => true
```

## Parameters

| Name    | Type    | Description |
| :------ | :------ | :---------- |
| `value` | `T`     | Any value.  |
| `_args` | `any[]` |             |

### Type parameters

| Name |
| :--- |
| `T`  |

## Returns

The first argument it receives.

### Return type

```ts
T
```
npm package: @lavadrop/is-boolean
Description: Checks if the primitive value of value is a boolean.
Author: Jed Mao
Latest version: 0.3.0

# @lavadrop/is-boolean

[![npm license](http://img.shields.io/npm/l/@lavadrop/is-boolean.svg)](https://www.npmjs.org/package/@lavadrop/is-boolean)
[![Travis Build Status](https://img.shields.io/travis/jedmao/lavadrop.svg)](https://travis-ci.org/jedmao/lavadrop)
[![codecov](https://codecov.io/gh/jedmao/lavadrop/branch/master/graph/badge.svg)](https://codecov.io/gh/jedmao/lavadrop)
[![Try @lavadrop/is-boolean on RunKit](https://badge.runkitcdn.com/@lavadrop/is-boolean.svg)](https://npm.runkit.com/@lavadrop/is-boolean)

Part of a [library](../../../../) of zero-dependency npm modules that do just
one thing.

- 100% [TypeScript](http://www.typescriptlang.org/) support.
- It's not a party without [`Lavadrop`](../../../../)!

[![npm](https://nodei.co/npm/@lavadrop/is-boolean.svg?downloads=true)](https://nodei.co/npm/@lavadrop/is-boolean/)

min + gzip | 85 bytes

[source](https://github.com/jedmao/lavadrop/blob/master/src/packages/is-boolean/isBoolean.ts)

Checks if the primitive value of `value` is a boolean.

## Usage

```ts
import isBoolean from '@lavadrop/is-boolean'

isBoolean(false)
// => true
```

## Parameters

| Name    | Type  | Description         |
| :------ | :---- | :------------------ |
| `value` | `any` | The value to check. |

## Returns

`true` if the primitive value of `value` is a boolean, else `false`.

### Return type

```ts
value is boolean
```
npm package: @lavadrop/kebab-case
Description: Converts a string value into kebab case.
Author: Jed Mao
Latest version: 3.0.0

# @lavadrop/kebab-case

[![npm license](http://img.shields.io/npm/l/@lavadrop/kebab-case.svg)](https://www.npmjs.org/package/@lavadrop/kebab-case)
[![Travis Build Status](https://img.shields.io/travis/jedmao/lavadrop.svg)](https://travis-ci.org/jedmao/lavadrop)
[![codecov](https://codecov.io/gh/jedmao/lavadrop/branch/master/graph/badge.svg)](https://codecov.io/gh/jedmao/lavadrop)
[![Try @lavadrop/kebab-case on RunKit](https://badge.runkitcdn.com/@lavadrop/kebab-case.svg)](https://npm.runkit.com/@lavadrop/kebab-case)

Part of a [library](../../../../) of zero-dependency npm modules that do just
one thing.

- 100% [TypeScript](http://www.typescriptlang.org/) support.
- It's not a party without [`Lavadrop`](../../../../)!

[![npm](https://nodei.co/npm/@lavadrop/kebab-case.svg?downloads=true)](https://nodei.co/npm/@lavadrop/kebab-case/)

min + gzip | 200 bytes

[source](https://github.com/jedmao/lavadrop/blob/master/src/packages/kebab-case/kebabCase.ts)

Converts a string value into [kebab case](https://en.wikipedia.org/wiki/Kebab_case).

## Usage

```ts
import kebabCase from '@lavadrop/kebab-case'

kebabCase('fooBARBaz')
// => 'foo-bar-baz'
```

## Parameters

| Name    | Type     | Description            |
| :------ | :------- | :--------------------- |
| `value` | `string` | The string to convert. |

## Returns

The kebab-cased string.

### Return type

```ts
string
```
npm package: @lavadrop/omit
Description: The opposite of @lavadrop/pick; this method creates an object composed of the object's own properties that are not in the list of omitted keys.
Author: Jed Mao
Latest version: 0.4.0

# @lavadrop/omit

[![npm license](http://img.shields.io/npm/l/@lavadrop/omit.svg)](https://www.npmjs.org/package/@lavadrop/omit)
[![Travis Build Status](https://img.shields.io/travis/jedmao/lavadrop.svg)](https://travis-ci.org/jedmao/lavadrop)
[![codecov](https://codecov.io/gh/jedmao/lavadrop/branch/master/graph/badge.svg)](https://codecov.io/gh/jedmao/lavadrop)
[![Try @lavadrop/omit on RunKit](https://badge.runkitcdn.com/@lavadrop/omit.svg)](https://npm.runkit.com/@lavadrop/omit)

Part of a [library](../../../../) of zero-dependency npm modules that do just
one thing.

- 100% [TypeScript](http://www.typescriptlang.org/) support.
- It's not a party without [`Lavadrop`](../../../../)!

[![npm](https://nodei.co/npm/@lavadrop/omit.svg?downloads=true)](https://nodei.co/npm/@lavadrop/omit/)

min + gzip | 114 bytes

[source](https://github.com/jedmao/lavadrop/blob/master/src/packages/omit/omit.ts)

The opposite of [pick](/pick); this method creates an object composed of the
object's own properties that are not in the list of omitted keys.

## Usage

```ts
import omit from '@lavadrop/omit'

const obj = { a: 1, b: 2, c: 3 }
omit(obj, 'a', 'c')
// => { b: 2 }
```

## Parameters

| Name     | Type          | Description              |
| :------- | :------------ | :----------------------- |
| `object` | `T`           | The source object.       |
| `keys`   | `[K, ...K[]]` | The object keys to omit. |

### Type parameters

| Name | Constraint |
| :--- | :--------- |
| `T`  | `object`   |
| `K`  | `keyof T`  |

## Returns

A new object with specified keys omitted.

### Return type

```ts
Omit<T, K>
```
npm package: @lavadrop/pick
Description: Creates an object composed of the picked object properties.
Author: Jed Mao
Latest version: 0.8.0

# @lavadrop/pick

[![npm license](http://img.shields.io/npm/l/@lavadrop/pick.svg)](https://www.npmjs.org/package/@lavadrop/pick)
[![Travis Build Status](https://img.shields.io/travis/jedmao/lavadrop.svg)](https://travis-ci.org/jedmao/lavadrop)
[![codecov](https://codecov.io/gh/jedmao/lavadrop/branch/master/graph/badge.svg)](https://codecov.io/gh/jedmao/lavadrop)
[![Try @lavadrop/pick on RunKit](https://badge.runkitcdn.com/@lavadrop/pick.svg)](https://npm.runkit.com/@lavadrop/pick)

Part of a [library](../../../../) of zero-dependency npm modules that do just
one thing.

- 100% [TypeScript](http://www.typescriptlang.org/) support.
- It's not a party without [`Lavadrop`](../../../../)!

[![npm](https://nodei.co/npm/@lavadrop/pick.svg?downloads=true)](https://nodei.co/npm/@lavadrop/pick/)

min + gzip | 99 bytes

[source](https://github.com/jedmao/lavadrop/blob/master/src/packages/pick/pick.ts)

Creates an object composed of the picked `object` properties.

## Usage

```ts
import pick from '@lavadrop/pick'

const obj = { a: 1, b: 2, c: 3 }
pick(obj, 'a', 'c')
// => { a: 1, c: 3 }
```

## Parameters

| Name     | Type  | Description                 |
| :------- | :---- | :-------------------------- |
| `object` | `T`   | The source object.          |
| `paths`  | `K[]` | The property paths to pick. |

### Type parameters

| Name | Constraint |
| :--- | :--------- |
| `T`  | `object`   |
| `K`  | `keyof T`  |

## Returns

A new object composed of the picked `object` properties.

### Return type

```ts
Partial<Pick<T, K>>
```
npm package: @lavadrop/pick-by
Description: Creates an object composed of the object properties for which predicate returns truthy.
Author: Jed Mao
Latest version: 0.3.0

# @lavadrop/pick-by

[![npm license](http://img.shields.io/npm/l/@lavadrop/pick-by.svg)](https://www.npmjs.org/package/@lavadrop/pick-by)
[![Travis Build Status](https://img.shields.io/travis/jedmao/lavadrop.svg)](https://travis-ci.org/jedmao/lavadrop)
[![codecov](https://codecov.io/gh/jedmao/lavadrop/branch/master/graph/badge.svg)](https://codecov.io/gh/jedmao/lavadrop)
[![Try @lavadrop/pick-by on RunKit](https://badge.runkitcdn.com/@lavadrop/pick-by.svg)](https://npm.runkit.com/@lavadrop/pick-by)

Part of a [library](../../../../) of zero-dependency npm modules that do just
one thing.

- 100% [TypeScript](http://www.typescriptlang.org/) support.
- It's not a party without [`Lavadrop`](../../../../)!

[![npm](https://nodei.co/npm/@lavadrop/pick-by.svg?downloads=true)](https://nodei.co/npm/@lavadrop/pick-by/)

min + gzip | 124 bytes

[source](https://github.com/jedmao/lavadrop/blob/master/src/packages/pick-by/pickBy.ts)

Creates an object composed of the object properties for which predicate returns truthy.

## Usage

```ts
import pickBy from '@lavadrop/pick-by'

const obj = { a: 0, b: '', c: true, d: 'hello' }
pickBy(obj)
// => { c: true, d: 'hello' }
```

## Parameters

| Name        | Type                                              | Description                        |
| :---------- | :------------------------------------------------ | :--------------------------------- |
| `object`    | `T`                                               | The source object.                 |
| `predicate` | `<K extends keyof T>(value: T[K], key: K) => any` | The function invoked per property. |

### Type parameters

| Name | Constraint |
| :--- | :--------- |
| `T`  | `object`   |
| `K`  | `keyof T`  |

## Returns

The new object.

### Return type

```ts
Partial<T>
```
npm package: @lavadrop/sleep
Description: Sleeps for a specified duration.
Author: Jed Mao
Latest version: 0.5.1

# @lavadrop/sleep

[![npm license](http://img.shields.io/npm/l/@lavadrop/sleep.svg)](https://www.npmjs.org/package/@lavadrop/sleep)
[![Travis Build Status](https://img.shields.io/travis/jedmao/lavadrop.svg)](https://travis-ci.org/jedmao/lavadrop)
[![codecov](https://codecov.io/gh/jedmao/lavadrop/branch/master/graph/badge.svg)](https://codecov.io/gh/jedmao/lavadrop)
[![Try @lavadrop/sleep on RunKit](https://badge.runkitcdn.com/@lavadrop/sleep.svg)](https://npm.runkit.com/@lavadrop/sleep)

Part of a [library](../../../../) of zero-dependency npm modules that do just
one thing.

- 100% [TypeScript](http://www.typescriptlang.org/) support.
- It's not a party without [`Lavadrop`](../../../../)!

[![npm](https://nodei.co/npm/@lavadrop/sleep.svg?downloads=true)](https://nodei.co/npm/@lavadrop/sleep/)

min + gzip | 93 bytes

[source](https://github.com/jedmao/lavadrop/blob/master/src/packages/sleep/sleep.ts)

Sleeps for a specified `duration`.

## Usage

```ts
import sleep from '@lavadrop/sleep'

async function brb() {
console.log('Be back in 42 seconds...')
await sleep(42000)
console.log("OK, I'm back!")
}
```

## Parameters

| Name       | Type     | Description                    |
| :--------- | :------- | :----------------------------- |
| `duration` | `number` | Time in milliseconds to sleep. |

## Returns

A `Promise` that resolves when the specified `duration` has ellapsed.

### Return type

```ts
Promise<void>
```
npm package: @lavadrop/snake-case
Description: Converts a string value into snake case.
Author: Jed Mao
Latest version: 0.4.0

# @lavadrop/snake-case

[![npm license](http://img.shields.io/npm/l/@lavadrop/snake-case.svg)](https://www.npmjs.org/package/@lavadrop/snake-case)
[![Travis Build Status](https://img.shields.io/travis/jedmao/lavadrop.svg)](https://travis-ci.org/jedmao/lavadrop)
[![codecov](https://codecov.io/gh/jedmao/lavadrop/branch/master/graph/badge.svg)](https://codecov.io/gh/jedmao/lavadrop)
[![Try @lavadrop/snake-case on RunKit](https://badge.runkitcdn.com/@lavadrop/snake-case.svg)](https://npm.runkit.com/@lavadrop/snake-case)

Part of a [library](../../../../) of zero-dependency npm modules that do just
one thing.

- 100% [TypeScript](http://www.typescriptlang.org/) support.
- It's not a party without [`Lavadrop`](../../../../)!

[![npm](https://nodei.co/npm/@lavadrop/snake-case.svg?downloads=true)](https://nodei.co/npm/@lavadrop/snake-case/)

min + gzip | 202 bytes

[source](https://github.com/jedmao/lavadrop/blob/master/src/packages/snake-case/snakeCase.ts)

Converts a string value into [snake case](https://en.wikipedia.org/wiki/Snake_case).

## Usage

```ts
import snakeCase from '@lavadrop/snake-case'

snakeCase('fooBARBaz')
// => 'foo_bar_baz'
```

## Parameters

| Name    | Type     | Description            |
| :------ | :------- | :--------------------- |
| `value` | `string` | The string to convert. |

## Returns

The snake-cased string.

### Return type

```ts
string
```
npm package: @lavadrop/throttle
Description: Creates a throttled function that only invokes func at most once per every wait milliseconds.
Author: Jed Mao
Latest version: 0.4.1

# @lavadrop/throttle

[![npm license](http://img.shields.io/npm/l/@lavadrop/throttle.svg)](https://www.npmjs.org/package/@lavadrop/throttle)
[![Travis Build Status](https://img.shields.io/travis/jedmao/lavadrop.svg)](https://travis-ci.org/jedmao/lavadrop)
[![codecov](https://codecov.io/gh/jedmao/lavadrop/branch/master/graph/badge.svg)](https://codecov.io/gh/jedmao/lavadrop)
[![Try @lavadrop/throttle on RunKit](https://badge.runkitcdn.com/@lavadrop/throttle.svg)](https://npm.runkit.com/@lavadrop/throttle)

Part of a [library](../../../../) of zero-dependency npm modules that do just
one thing.

- 100% [TypeScript](http://www.typescriptlang.org/) support.
- It's not a party without [`Lavadrop`](../../../../)!

[![npm](https://nodei.co/npm/@lavadrop/throttle.svg?downloads=true)](https://nodei.co/npm/@lavadrop/throttle/)

min + gzip | 192 bytes

[source](https://github.com/jedmao/lavadrop/blob/master/src/packages/throttle/throttle.ts)

Creates a throttled function that only invokes `func` at most once per every
`wait` milliseconds.

## Usage

```ts
import throttle from '@lavadrop/throttle'

const logScrollTop = e => { console.log(`top: ${e.target.scrollTop}`) }
const [throttled, cancel] = throttle(logScrollTop, 100)
window.addEventListener('scroll', throttled)
cancel()
```

## Parameters

| Name        | Type      | Description                                                                      |
| :---------- | :-------- | :------------------------------------------------------------------------------- |
| `func`      | `TFunc`   | The function to throttle.                                                        |
| `wait`      | `number`  | The number of milliseconds to which invocations are throttled.                   |
| `callFirst` | `boolean` | Specifies that `func` should be invoked on the leading edge of the wait timeout. |

### Type parameters

| Name    | Constraint                |
| :------ | :------------------------ |
| `TFunc` | `(...args: any[]) => any` |

## Returns

A new throttled function paired with a cancel function.

### Return type

```ts
[(...args: Parameters<TFunc>) => any, () => void]
```
npm package: @lavaldi/normalized-components
Description: normalized styled-components
Author: Claudia Valdivieso
Latest version: 1.1.0

# normalized-components

normalize.css as styled-components 😎

## Install

```bash
$ npm install @lavaldi/normalized-components --save-dev
```

## Usage

```js
import { Button } from '@lavaldi/normalized-components';

export default () => <Button>Click Here!</Button>;
```
npm package: @lavalink/discord.js
Description: Lavalink Library based on lavalink.js made for discord.js
Author: Yukine
Latest version: 0.1.0

# discord.js

[![lavalibs support server](https://discordapp.com/api/guilds/494948120103485440/embed.png)](https://discord.gg/jXSKeW5)

Lavalink Library based on lavalink.js made for discord.js