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

Why can rails not find a route created by a helper? -

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -