JSPM

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

Stop iteration after n items have been received

Package Exports

  • it-take

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-take) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

it-take

Build status Coverage Status Dependencies Status

Stop iteration after n items have been received.

For when you only want a few values out of an iterable.

Install

$ npm install --save it-take

Usage

const take = require('it-take')
const all = require('it-all')

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

const arr = await all(take(values, 2))

console.info(arr) // 0, 1