Get unlimited public & private packages + team-based management with npm Teams.Learn more »

noop-process

4.0.0 • Public • Published

noop-process Build Status

Create a noop process and get the PID

Useful for testing purposes.

Install

$ npm install noop-process

Usage

const noopProcess = require('noop-process');
 
(async () => {
    const pid = await noopProcess();
 
    console.log(pid);
    //=> 1337
})();

API

noopProcess(options?)

Creates a noop process.

Returns a Promise<number> with the process ID of the created process.

options

Type: object

title

Type: string

Give the process a title to make it easier to see it in ps or kill it with killall.

Maximum 15 characters, as anything longer will be truncated by the system.

persistent

Type: boolean
Default: false

Let the process continue to live after the main process exits.

onlyForceKillable

Type: boolean
Default: false

Make the process only killable with SIGKILL.

noopProcess.cleanup()

All the processes are cleaned up when the main process exits, but you can use this if you need them cleaned up earlier.

Install

npm i noop-process

DownloadsWeekly Downloads

29

Version

4.0.0

License

MIT

Unpacked Size

4.45 kB

Total Files

4

Last publish

Collaborators

  • avatar