async-iterator-batch

Takes an async iterator that emits variable length arrays and emits them as fixed size batches

Please use it-batch instead, it's a drop-in replacement for this module
Last updated 7 years ago by achingbrain .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install async-iterator-batch 
SYNC missed versions from official npm registry.

async-iterator-batch

Build status Coverage Status Dependencies Status

Takes an async iterator that emits variable length arrays and emits them as fixed-size batches

The final batch may be smaller than the max.

Install

$ npm install --save async-iterator-batch

Usage

const batch = require('async-iterator-batch')
const all = require('async-iterator-all')

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

const result = await all(batch(iterator([[0, 1, 2], [3], [4]]), 2))

console.info(result) // [0, 1], [2, 3], [4]

Current Tags

  • 0.0.1                                ...           latest (7 years ago)

1 Versions

  • 0.0.1 [deprecated]           ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (5)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |