Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node.js module for spawning phantomas process and getting results #152

Closed
macbre opened this issue Dec 4, 2013 · 6 comments
Closed

node.js module for spawning phantomas process and getting results #152

macbre opened this issue Dec 4, 2013 · 6 comments
Assignees
Milestone

Comments

@macbre
Copy link
Owner

macbre commented Dec 4, 2013

Implement phantomas module for node.js that will expose an API for spawning phantomas process and getting results.

API usage:

var phantomas = require('phantomas'),
  task;

console.log(phantomas.version); // 0.9.0

task = phantomas(url, options, function(err, res) {
  // err: exit code
  // res: parsed JSON or raw data (TAP / CSV / XML)
});

console.log(task.pid); // process ID

// Streams handling
task.stdout.pipe(process.stdout);
task.stderr.pipe(process.stderr);

// Events handling
task.on('progress', function(progress) {
  // ...
});

task.on('results', function(results) {
  // raw data (formatted as specified by --format option)
});

task.on('data', function(data) {
  // parsed JSON results (in --format=json)
});

task.on('error', function(err) {
  // ..
});

As suggested in #112

@desenmeng
Copy link

when i can use it?

@macbre
Copy link
Owner Author

macbre commented Dec 5, 2013

It will probably be implemented early next year.

@macbre
Copy link
Owner Author

macbre commented Dec 16, 2013

IPC in PhantomJS

macbre added a commit that referenced this issue Dec 16, 2013
This was referenced Dec 17, 2013
@macbre
Copy link
Owner Author

macbre commented Dec 18, 2013

After @43a5720 npm module exposes path property:

{ [Function: phantomas]
  path: '/home/macbre/node_modules/phantomas',
  version: '0.10.1' }

@macbre
Copy link
Owner Author

macbre commented Dec 25, 2013

@desenmeng
Copy link

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants