JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 295239
  • Score
    100M100P100Q157263F
  • License ISC

Returns the first result from an async iterator

Package Exports

  • it-first

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (it-first) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

it-first

Build status Coverage Status Dependencies Status

Returns the first result from an (async) iterable.

Mostly useful for tests.

Install

$ npm install --save it-first

Usage

const first = require('it-first')

// This can also be an iterator, async iterator, generator, etc
const values = [0, 1, 2, 3, 4]

const res = await first(values)

console.info(res) // 0