Skip to content

Instantly share code, notes, and snippets.

@ami-GS
Created March 12, 2014 08:44
Show Gist options
  • Save ami-GS/9503132 to your computer and use it in GitHub Desktop.
Save ami-GS/9503132 to your computer and use it in GitHub Desktop.
get process ID using Node.js and its child_process
var spawn = require('child_process').spawn;
var grep = spawn('grep', ['ssh']);
console.log(grep.pid);
grep.stdin.end();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment