{ } qjs-modules

child-process

Source: quickjs-child-process.c — module exports ChildProcess, a function list, and default.

Spawning and managing child processes (Node child_process-flavored).

Module functions

FunctionArgsDescription
exec(command, options)1Runs a command via the shell, asynchronously.
execSync(command, options)1Synchronous variant of exec.
spawn(file, args, options)1Spawns a process without a shell, asynchronously.
spawnSync(file, args, options)1Synchronous variant of spawn.
kill(pid, signal)1Sends a signal to a process.

ChildProcess

new ChildProcess([options])   // length 1

Methods

MethodArgsDescription
wait()0Waits for the process to change state; returns status.
kill([signal])0Sends a signal to this process.
[Symbol.toPrimitive]()0Primitive coercion (the pid).

Properties (read-only, mostly enumerable)

PropertyDescription
fileExecutable path.
cwdWorking directory.
argsArgument vector.
envEnvironment map.
stdioArray of stdio streams/fds.
pidProcess id.
exitcodeExit code once exited.
termsigSignal that terminated the process.
exitedWhether it has exited.
signaledWhether it was terminated by a signal.
stoppedWhether it is stopped.
continuedWhether it was continued.