Static methods

staticexec(command:String, callback:ChildProcessExecCallback):ChildProcess

staticexec(command:String, options:ChildProcessExecOptions, callback:ChildProcessExecCallback):ChildProcess

Runs a command in a shell and buffers the output.

command is the command to run, with space-separated arguments.

The default options are:

{ encoding: 'utf8',
  timeout: 0,
  maxBuffer: 200*1024,
  killSignal: 'SIGTERM',
  cwd: null,
  env: null }

staticexecFile(file:String, ?callback:ChildProcessExecCallback):ChildProcess

staticexecFile(file:String, args:Array<String>, options:ChildProcessExecFileOptions, ?callback:ChildProcessExecCallback):ChildProcess

staticexecFile(file:String, options:ChildProcessExecFileOptions, ?callback:ChildProcessExecCallback):ChildProcess

staticexecFile(file:String, args:Array<String>, ?callback:ChildProcessExecCallback):ChildProcess

This is similar to exec except it does not execute a subshell but rather the specified file directly. This makes it slightly leaner than exec

staticexecFileSync(command:String, ?args:Array<String>):EitherType<String, Buffer>

staticexecFileSync(command:String, ?options:ChildProcessSpawnSyncOptions):EitherType<String, Buffer>

staticexecFileSync(command:String, args:Array<String>, ?options:ChildProcessSpawnSyncOptions):EitherType<String, Buffer>

Synchronous version of execFile.

execFileSync will not return until the child process has fully closed. When a timeout has been encountered and killSignal is sent, the method won't return until the process has completely exited. That is to say, if the process handles the SIGTERM signal and doesn't exit, your process will wait until the child process has exited.

If the process times out, or has a non-zero exit code, this method will throw. The Error object will contain the entire result from spawnSync

staticexecSync(command:String, ?options:ChildProcessSpawnSyncOptions):EitherType<String, Buffer>

Synchronous version of exec.

execSync will not return until the child process has fully closed. When a timeout has been encountered and killSignal is sent, the method won't return until the process has completely exited. That is to say, if the process handles the SIGTERM signal and doesn't exit, your process will wait until the child process has exited.

If the process times out, or has a non-zero exit code, this method will throw. The Error object will contain the entire result from spawnSync

staticfork(modulePath:String, ?args:Array<String>):ChildProcess

staticfork(modulePath:String, args:Array<String>, options:ChildProcessForkOptions):ChildProcess

staticfork(modulePath:String, options:ChildProcessForkOptions):ChildProcess

This is a special case of the spawn functionality for spawning Node processes. In addition to having all the methods in a normal ChildProcess instance, the returned object has a communication channel built-in. See send for details.

staticspawn(command:String, ?args:Array<String>):ChildProcess

staticspawn(command:String, ?options:ChildProcessSpawnOptions):ChildProcess

staticspawn(command:String, args:Array<String>, ?options:ChildProcessSpawnOptions):ChildProcess

Launches a new process with the given command, with command line arguments in args. If omitted, args defaults to an empty Array.

The third argument is used to specify additional options, which defaults to:

{ cwd: null,
  env: process.env
}

Note that if spawn receives an empty options object, it will result in spawning the process with an empty environment rather than using process.env. This due to backwards compatibility issues with a deprecated API.

staticspawnSync(command:String, ?options:ChildProcessSpawnSyncOptions):ChildProcessSpawnSyncResult

staticspawnSync(command:String, args:Array<String>, ?options:ChildProcessSpawnSyncOptions):ChildProcessSpawnSyncResult

Synchronous version of spawn.

spawnSync will not return until the child process has fully closed. When a timeout has been encountered and killSignal is sent, the method won't return until the process has completely exited. That is to say, if the process handles the SIGTERM signal and doesn't exit, your process will wait until the child process has exited.