peerigon / phridge

A bridge between node and PhantomJS
The Unlicense
519 stars 50 forks source link

read() function not available on cleanStdout #15

Closed frank-weindel closed 10 years ago

frank-weindel commented 10 years ago

In older versions of phridge that use HTTP to communicate to phantom, I was using the phantom.childProcess.stdout stream to capture and log javascript errors that occurred within a phantom page. I was simply calling read() on it after loading a page and writing the string it returned to a file. This was working remarkably well.

However, in the latest versions of Phridge that use stdin/out to communicate with phantom, I no longer get intelligible responses from that stream. I noticed the phantom.childProcess.cleanStdout and thought it would be the answer to my prayers. However, I cannot even call read() on this stream because it does not define a function by that name. I've noticed, oddly enough, that this stream is marked as 'readable'. How should I read from this stream? Or is this even the right way to get at these errors?

jhnns commented 10 years ago

https://github.com/dominictarr/map-stream implemented some weird interface, hence I switched back to node's regular TransformStream