lib/os/pid-find.js
function pidFind(pid) {
  if (!_.isFinite(pid)) return false;
  try {
    if (runningAsRoot()) {
      return process.kill(pid, 0);
    } else {
      return !!ps(pid);
    }
  } catch (e) {
    return false;
  }
}
function pidFind(pid) {
  if (!_.isFinite(pid)) return false;
  try {
    if (runningAsRoot()) {
      return process.kill(pid, 0);
    } else {
      return !!ps(pid);
    }
  } catch (e) {
    return false;
  }
}
function pidFind ( pid ) { if ( ! _ . isFinite ( pid ) ) return false ; try { if ( runningAsRoot ( ) ) { return process . kill ( pid , 0 ) ; } else { return ! ! ps ( pid ) ; } } catch ( e ) { return false ; } }
Check if the given PID exists
@function $os~pidFind
@param {number} pid - Process ID
@returns {boolean}
@example
// Check if the PID 123213 exists
$os.pidFind(123213);
// => true
Check if the given PID exists