How to run example in 'npm phantom'
Download and run install.js npm phantom >> PhantomJS is already installed
at /usr/local/bin/phantomjs. Create a file pizza.js with working Phantomjs
example and pizzaTest.js to test it.
var childProcess = require('child_process')
var phantomjs = require('phantomjs')
var binPath = phantomjs.path
var childArgs = [
path.join(__dirname, 'pizza.js'),
]
childProcess.execFile(binPath, childArgs, function(err, stdout, stderr) {
console.log(stdout);
})
an recive an error:
/home/khaljava/coder/phantom/pizzaTest.js:6
path.join(__dirname, 'pizza.js'),
^
No comments:
Post a Comment