JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 172105
  • Score
    100M100P100Q167982F
  • License MIT

Check if a process is running

Package Exports

  • process-exists

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 (process-exists) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

process-exists

Check if a process is running

Install

$ npm install process-exists

Usage

const processExists = require('process-exists');

(async () => {
    console.log(await processExists(process.pid));
    //=> true

    const exists = await processExists.all([process.pid, 'foo']);

    console.log(exists.get(process.pid));
    //=> true

    console.log(exists.get('foo'));
    //=> false

    console.log(processExists.filterExists(exists));
    //=> [process.pid]
})();

API

processExists(input)

Returns a Promise<boolean>.

input

Type: number | string

Process ID or name to check.

processExists.all(input)

Returns a Promise<Map> with the process name/ID as key and the status as a boolean value.

input

Type: Array<number | string>

Process IDs or names to check.

processExists.filterExists(input)

Returns an Array<number | string> with the processes that exist.

input

Type: Array<number | string>

Process IDs or names to check.