pull-iterable
v0.1.0
Published
pull-stream source for ES6 iterables
Downloads
11
Readme
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 )
})
)