1.0.5 • Published 5 years ago

xrtlibrary-processutilities v1.0.5

Weekly downloads
-
License
BSD-3-Clause
Repository
-
Last release
5 years ago

XRTLibrary-ProcessUtilities

Introduction

This library contains several process utilities.

Installation

To install this package, you can use NPM by typing following command:

npm install xrtlibrary-processutilities --save

Then you can import this library in your JavaScript code:

const XRTLibProcessUtilities = require("xrtlibrary-processutilities");

Examples

Download this package and see the "examples" directory.

APIs

IsProcessRunning(pid)

Check whether a process is running.

Parameter(s):

  • pid (Number): The process ID.

Return value:

  • (Boolean): True if so.

WaitForChildProcess(cp, cancellator)

Wait for specified child process.

Parameter(s):

  • cp (ChildProcess): The child process.
  • cancellator (ConditionalSynchronizer): (Optional) The cancellator.

Return value:

  • (Promise<{code: ?Number, signal: ?String}>): The promise object (resolves with the exit information, rejects when cancelled or error occurred).

IsChildProcessExited(cp)

Check whether a child process was exited.

Parameter(s):

  • cp (ChildProcess): The child process.

Return value:

  • (Boolean): True if so.