Process object

Using the Process class, your program can run another program as a subprocess, receiving its stdout and stderr output and passing data to its stdin stream. 


- boolean, process running state, true - process is alive.


( exepath: string [, arg1: string, arg2: string, ...] [,#detached] ) : Process

Static method, constructs new child process proxy object and starts process by running executable on path with command line parameters (optional).

By default started process will belong to the same process group - will be terminated by itself or on exit of this process. But if #detached parameter is provided the child process will survive this process termination - torn off child process.

( event: string, callback: function ) : this

Subscribes the callback function to one of process events:

The event name may contain ".namespace" part that can be used in .off() call.

( event: string | callback: function ) : this

Unsubscribe callback either by its name or by its function reference.

Event name may contain only namespace part, so this:".namespace") will unsubscribe all handlers that were set with that namespace.

( data: string ) : this

The method sends data to the stdin stream of the child process.

If called more than once, this method shall be invoked only after completion of previous send operation (after receiving event stdin).

( )

Makes an attempt to terminate the child process.