phantomjs-stream

1.1.1 • Public • Published

phantomjs-stream

Simple streaming wrapper around phantomjs(1).

Example

var phantom = require('phantomjs-stream');

var browser = phantom();

browser.pipe(process.stdout);
setTimeout(browser.kill.bind(browser), 2000);

browser.end('console.log(window.location)');

Installation

$ npm install phantomjs-stream

API

phantom()

Create a duplex stream around a newly spawned phantomjs which forwards written data to phantomjs and outputs the browser's console output.

phantom#kill()

Kill the child process.

phantom#on('exit', fn)

Emitted when the underlying phantomjs exits. There can be multiple reasons for this:

  • phantom#kill() was called
  • phantom.exit() was sent as a script
  • there was a fatal error

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i phantomjs-stream

Weekly Downloads

476

Version

1.1.1

License

MIT

Last publish

Collaborators

  • juliangruber