# async-iterator-to-array

> Collects all values from an async iterator and returns them as an array

Latest version **0.0.1** (published 2019-04-18) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install async-iterator-to-array
pnpm add async-iterator-to-array
yarn add async-iterator-to-array
bun add async-iterator-to-array
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2019-04-18 |
| First published | 2019-04-18 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Alex Potsides |
| Maintainers | achingbrain |

## Links

- npm: https://www.npmjs.com/package/async-iterator-to-array
- Repository: https://github.com/achingbrain/async-iterator-to-array
- Homepage: https://github.com/achingbrain/async-iterator-to-array#readme
- Issues: https://github.com/achingbrain/async-iterator-to-array/issues
- npm.io page: https://npm.io/package/async-iterator-to-array

## Recent versions

- 0.0.1 (latest) — 2019-04-18

## README

# async-iterator-to-array

[![Build status](https://travis-ci.org/achingbrain/async-iterator-to-array.svg?branch=master)](https://travis-ci.org/achingbrain/async-iterator-to-array?branch=master) [![Coverage Status](https://coveralls.io/repos/github/achingbrain/async-iterator-to-array/badge.svg?branch=master)](https://coveralls.io/github/achingbrain/async-iterator-to-array?branch=master) [![Dependencies Status](https://david-dm.org/achingbrain/async-iterator-to-array/status.svg)](https://david-dm.org/achingbrain/async-iterator-to-array)

> Collects all values from an async iterator and returns them as an array

Mostly useful for tests.

## Install

```sh
$ npm install --save async-iterator-to-array
```

## Usage

```javascript
const toArray = require('async-iterator-to-array')

async function * iterator (values) {
  for (let i = 0; i < values.length; i++) {
    yield values[i]
  }
}

const arr = await toArray(iterator([0, 1, 2, 3, 4]))

console.info(arr) // 0, 1, 2, 3, 4
```

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