node.js - How do I read from a highland stream? -


so have highland stream:

var getdata = highland.wrapcallback(fs.readfile); var filestream = getdata('myfile') console.log(filestream) 

how read filestream? according the highland docs, there no read() method on streams.

you need cause 'thunk' - can done using .each(), .toarray() or .apply() pull data out of stream. say, can use .pull() to read 1 value stream. .collect() not cause thunk, batch data once read itself, if want .collect() forcing read you'll want use .toarray().


Comments

Popular posts from this blog

hibernate - How to load global settings frequently used in application in Java -

python 3.x - Mapping specific letters onto a list of words -

objective c - Ownership modifiers with manual reference counting -