# async-dash

> collections/object utilities with async/await support

Latest version **1.0.4** (published 2021-02-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install async-dash
pnpm add async-dash
yarn add async-dash
bun add async-dash
```

## 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.4 |
| Published | 2021-02-22 |
| First published | 2019-04-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 8.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | sarunya |
| Maintainers | sarunya |
| Keywords | async, array, lodash, await, async in lodash, async await map, await in lodash, async lodash, asynchronous lodash |

## Links

- npm: https://www.npmjs.com/package/async-dash
- Repository: https://github.com/sarunya/async-lodash
- Homepage: https://github.com/sarunya/async-lodash#readme
- Issues: https://github.com/sarunya/async-lodash/issues
- npm.io page: https://npm.io/package/async-dash

## Dependencies (1)

- [lodash](https://npm.io/package/lodash.md) ^4.17.11

## Recent versions

- 1.0.4 (latest) — 2021-02-22
- 1.0.3 — 2019-05-27
- 1.0.2 — 2019-05-27
- 1.0.1 — 2019-04-17
- 1.0.0 — 2019-04-16

## README

# async-lodash

Extended from lodash to make it work with async/await.

Collections/object utilities with async/await support.


# Usage In Nodejs

Async Methods supported

```js
_.asyncEach(array, asyncFn);
_.asyncReverseEach(array, asyncFn);
_.asyncParallelEach(array, asyncFn, size); //async function will be yielded paralelly in chunks of given size
_.asyncMap(array, asyncFn);
_.asyncRemove(array, asyncFn); //returns removed values as array
_.asyncFilter(array, asyncFn); //returns filtered values as array
_.asyncFilterOne(array, asyncFn); //returns filtered value
_.asyncSleep(timeinms);
```

Async Filter Array: 

```js
//just to make async
    arr = [16, 1, 2, 16, 32];
    filtered = await _.asyncFilter(arr, async (val) => {
        await _.asyncSleep(val * 10);
        return val % 16 === 0;
    })
    //filtered = [16,16,32]
```

Async Each: 
Executes the function for each value of array

```js
//just to make async
    arr = [16, 1, 2, 16, 32];
    await _.asyncEach(arr, async (val) => {
        await _.asyncSleep(10);
        console.log(val);
    })
    //16 1 2 16 32

    await _.asyncReverseEach(arr, async (val) => {
        await _.asyncSleep(10);
        console.log(val);
    })
    //32 16 2 1 16
```

Async Parallel Each: 
Yields the promise in chunks of size (_.asyncParallelEach(array, asyncFn, size)). Size will be defaulted to actual length of array 

```js
    await _.asyncParallelEach(array, async (val) => {
        await _.asyncSleep(100 * val);
        console.log("after 1000 ", val);
    }, 3)
```

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