5.0.0 • Published 3 years ago

noop-process v5.0.0

Weekly downloads
5
License
MIT
Repository
github
Last release
3 years ago

noop-process

Create a noop (no operation) process and get the PID

Useful for testing purposes.

Install

$ npm install noop-process

Usage

import noopProcess from 'noop-process';

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.

cleanUpNoopProcesses()

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

import {cleanUpNoopProcesses} from 'noop-process';

cleanUpNoopProcesses();
5.0.0

3 years ago

4.0.0

5 years ago

3.1.0

8 years ago

3.0.0

9 years ago

2.0.0

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago