Skip to content
Get PID of running process
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
test
.gitignore
.travis.yml
LICENSE
README.md
example.js
package.json

README.md

pidof

build status

Get the PID of a running process, or null if it couldn't be found. Tested on Mac OS X, Solaris and Linux. Guaranteed not to work on Windows.

Example

var pidof = require('pidof');

pidof('cron', function (err, pid) {
    if (err) {
        console.log('Weird error getting PIDs');
        console.log(err);
    } else {
        if (pid) {
            console.log('Found cron at pid ' + pid);
        } else {
            console.log('Seems like there\'s no cron on this system');
        }
    }
});

License

MIT

Something went wrong with that request. Please try again.