Simple streaming wrapper around phantomjs(1).
var phantom = require('phantomjs-stream');
var browser = phantom();
browser.pipe(process.stdout);
setTimeout(browser.kill.bind(browser), 2000);
browser.end('console.log(window.location)');
$ npm install phantomjs-stream
Create a duplex stream around a newly spawned phantomjs which forwards written data to phantomjs and outputs the browser's console output.
Kill the child process.
Emitted when the underlying phantomjs exits. There can be multiple reasons for this:
phantom#kill() was calledphantom.exit() was sent as a scriptMIT