JSPM

pidof

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 22858
  • Score
    100M100P100Q138266F

Get PID of a running process

Package Exports

  • pidof

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (pidof) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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