# @kristoferbaxter/async

> Async Utilities for Module Node Development.

Latest version **1.0.0** (published 2020-04-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @kristoferbaxter/async
pnpm add @kristoferbaxter/async
yarn add @kristoferbaxter/async
bun add @kristoferbaxter/async
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2020-04-27 |
| First published | 2020-04-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=12 |
| Dependencies | 0 |
| Unpacked size | 81.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Kristofer Baxter |
| Maintainers | kristoferbaxter |

## Links

- npm: https://www.npmjs.com/package/@kristoferbaxter/async
- npm.io page: https://npm.io/package/@kristoferbaxter/async

## Recent versions

- 1.0.0 (latest) — 2020-04-27
- 0.0.7 — 2020-04-23
- 0.0.6 — 2020-04-22
- 0.0.5 — 2020-04-22
- 0.0.4 — 2020-04-21
- 0.0.3 — 2020-04-21

## README

# Async Utilities

This project contains utilities one might use for Async work in ES2015 and later.

### Pool

Utility that completes as many simultaneous Promise resolutions as concurrency is defined. If you have expensive operations that do not need a stable result order for completion, then this utility is for you.

```typescript
async function pool<R, T>(
  items: Array<R>,
  iteratorFn: (item: R, items: Array<R>) => T,
  concurrency: number = cpus().length,
): Promise<Array<T>> {}
```

Passing an `Array<R> of items`, and an interator function that executes an expensive operation resulting in `T` will happen concurrently as determined by `concurrency`.

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