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?
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 callingread()
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 callread()
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?