install.js
function tryPhantomjsInLib() {
  return Q.fcall(function () {
    return findValidPhantomJsBinary(path.resolve(__dirname, './lib/location.js'))
  }).then(function (binaryLocation) {
    if (binaryLocation) {
      console.log('PhantomJS is previously installed at', binaryLocation)
      exit(0)
    }
  }).fail(function () {
    // silently swallow any errors
  })
}
function tryPhantomjsInLib() {
  return Q.fcall(function () {
    return findValidPhantomJsBinary(path.resolve(__dirname, './lib/location.js'))
  }).then(function (binaryLocation) {
    if (binaryLocation) {
      console.log('PhantomJS is previously installed at', binaryLocation)
      exit(0)
    }
  }).fail(function () {
    // silently swallow any errors
  })
}
function tryPhantomjsInLib ( ) { return Q . fcall ( function ( ) { return findValidPhantomJsBinary ( path . resolve ( __dirname , './lib/location.js' ) ) } ) . then ( function ( binaryLocation ) { if ( binaryLocation ) { console . log ( 'PhantomJS is previously installed at' , binaryLocation ) exit ( 0 ) } } ) . fail ( function ( ) { // silently swallow any errors } ) }
Check to see if the binary in lib is OK to use. If successful, exit the process.
Check to see if the binary in lib is OK to use . If successful exit the process .