pull-iterable

v0.1.0
pull-stream source for ES6 iterables

pull-iterable

pull-stream source for ES6 iterables

npm install pull-iterable

const pull = require( 'pull-stream' )
const iterable = require( 'pull-iterable' )

function* range( start, end ){
  for( var i = start; i < end; i++ )
    yield i
}

pull(
  iterable( range( 1, 5 ) ),
  pull.collect( ( err, result ) => {
    console.log( result )
  })
)

pull(
  iterable( [ 1, 2, 3, 4 ] ),
  pull.collect( ( err, result ) => {
    console.log( result )
  })
)

pull(
  iterable( 'hello world' ),
  pull.collect( ( err, result ) => {
    console.log( result )
  })
)
npm i pull-iterable

Metadata

  • MIT
  • Whatever
  • Nik Coughlin
  • released 6/19/2017

Downloads

Maintainers