# async-iterator-first

> Returns the first result from an async iterator

Latest version **1.0.0** (published 2019-05-15) · ISC license · 0 weekly downloads

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

## Install

```sh
npm install async-iterator-first
pnpm add async-iterator-first
yarn add async-iterator-first
bun add async-iterator-first
```

## Health

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

Negative: deprecated.

## Facts

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

## Links

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

## Recent versions

- 1.0.0 (latest) — 2019-05-15
- 0.0.2 — 2019-04-18
- 0.0.1 — 2019-04-18

## README

# async-iterator-first

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

> Returns the first result from an async iterator

Mostly useful for tests.

## Install

```sh
$ npm install --save async-iterator-first
```

## Usage

```javascript
const first = require('async-iterator-first')

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

const res = await first(iterator([0, 1, 2, 3, 4]))

console.info(res) // 0
```

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