pidof

Get PID of a running process

3 个版本
安装
npm install pidof
yarn add pidof
pnpm add pidof
bun add pidof
README

pidof

build status

Get the PID of a running process, or null if it couldn't be found.

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');
        }
    }
});
版本列表
1.0.2 2012-08-11
1.0.1 2012-07-10
1.0.0 2012-06-16