phantomjs-stream

Simple streaming wrapper around phantomjs(1)

MIT 3 个版本
安装
npm install phantomjs-stream
yarn add phantomjs-stream
pnpm add phantomjs-stream
bun add phantomjs-stream
README

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

版本列表
1.1.1 2015-09-01
1.1.0 2015-09-01
1.0.0 2015-03-23