Static methods
staticexec(command:String, callback:ChildProcessExecCallback):ChildProcessObject
staticexec(command:String, options:ChildProcessExecOptions, callback:ChildProcessExecCallback):ChildProcessObject
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:Null<ChildProcessExecCallback>):ChildProcessObject
staticexecFile(file:String, args:Array<String>, options:ChildProcessExecFileOptions, ?callback:Null<ChildProcessExecCallback>):ChildProcessObject
staticexecFile(file:String, options:ChildProcessExecFileOptions, ?callback:Null<ChildProcessExecCallback>):ChildProcessObject
staticexecFile(file:String, args:Array<String>, ?callback:Null<ChildProcessExecCallback>):ChildProcessObject
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:Null<ChildProcessSpawnSyncOptions>):EitherType<String, Buffer>
staticexecFileSync(command:String, args:Array<String>, ?options:Null<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:Null<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>):ChildProcessObject
staticfork(modulePath:String, args:Array<String>, options:ChildProcessForkOptions):ChildProcessObject
staticfork(modulePath:String, options:ChildProcessForkOptions):ChildProcessObject
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>):ChildProcessObject
staticspawn(command:String, ?options:Null<ChildProcessSpawnOptions>):ChildProcessObject
staticspawn(command:String, args:Array<String>, ?options:Null<ChildProcessSpawnOptions>):ChildProcessObject
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:Null<ChildProcessSpawnSyncOptions>):ChildProcessSpawnSyncResult
staticspawnSync(command:String, args:Array<String>, ?options:Null<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.