phantomjs.js
function findExecutable(opt_exe) {
  var exe = opt_exe || io.findInPath(PHANTOMJS_EXE, true);
  if (!exe) {
    throw Error(
        'The PhantomJS executable could not be found on the current PATH. ' +
        'Please download the latest version from ' +
        'http://phantomjs.org/download.html and ensure it can be found on ' +
        'your PATH. For more information, see ' +
        'https://github.com/ariya/phantomjs/wiki');
  }
  if (!fs.existsSync(exe)) {
    throw Error('File does not exist: ' + exe);
  }
  return exe;
}
function findExecutable(opt_exe) {
  var exe = opt_exe || io.findInPath(PHANTOMJS_EXE, true);
  if (!exe) {
    throw Error(
        'The PhantomJS executable could not be found on the current PATH. ' +
        'Please download the latest version from ' +
        'http://phantomjs.org/download.html and ensure it can be found on ' +
        'your PATH. For more information, see ' +
        'https://github.com/ariya/phantomjs/wiki');
  }
  if (!fs.existsSync(exe)) {
    throw Error('File does not exist: ' + exe);
  }
  return exe;
}
function findExecutable ( opt_exe ) { var exe = opt_exe || io . findInPath ( PHANTOMJS_EXE , true ) ; if ( ! exe ) { throw Error ( 'The PhantomJS executable could not be found on the current PATH. ' + 'Please download the latest version from ' + 'http://phantomjs.org/download.html and ensure it can be found on ' + 'your PATH. For more information, see ' + 'https://github.com/ariya/phantomjs/wiki' ) ; } if ( ! fs . existsSync ( exe ) ) { throw Error ( 'File does not exist: ' + exe ) ; } return exe ; }
Finds the PhantomJS executable.
@param {string=} opt_exe Path to the executable to use.
@return {string} The located executable.
@throws {Error} If the executable cannot be found on the PATH, or if the
provided executable path does not exist.
Finds the PhantomJS executable .