Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including it-all with all npm packages installed. Try it out:

var itAll = require("it-all")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

it-all v1.0.2

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

it-all

Build status Coverage Status Dependencies Status

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

For when you need a one-liner to collect iterable values.

Install

$ npm install --save it-all

Usage

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(values)

console.info(arr) // 0, 1, 2, 3, 4
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free