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
| Function | Args | Description |
|---|---|---|
exec(command, options) | 1 | Runs a command via the shell, asynchronously. |
execSync(command, options) | 1 | Synchronous variant of exec. |
spawn(file, args, options) | 1 | Spawns a process without a shell, asynchronously. |
spawnSync(file, args, options) | 1 | Synchronous variant of spawn. |
kill(pid, signal) | 1 | Sends a signal to a process. |
ChildProcess
new ChildProcess([options]) // length 1Methods
| Method | Args | Description |
|---|---|---|
wait() | 0 | Waits for the process to change state; returns status. |
kill([signal]) | 0 | Sends a signal to this process. |
[Symbol.toPrimitive]() | 0 | Primitive coercion (the pid). |
Properties (read-only, mostly enumerable)
| Property | Description |
|---|---|
file | Executable path. |
cwd | Working directory. |
args | Argument vector. |
env | Environment map. |
stdio | Array of stdio streams/fds. |
pid | Process id. |
exitcode | Exit code once exited. |
termsig | Signal that terminated the process. |
exited | Whether it has exited. |
signaled | Whether it was terminated by a signal. |
stopped | Whether it is stopped. |
continued | Whether it was continued. |
Export list
Generated by utilities/doc-api.js from the child_process dump of utilities/api-surface.sh: 154 members. Edit the text above this block, not the block.
Functions: exec(), execSync(), kill(), spawn(), spawnSync()
Values: SIGABRT = 6, SIGALRM = 14, SIGBUS = 7, SIGCHLD = 17, SIGCONT = 18, SIGFPE = 8, SIGHUP = 1, SIGILL = 4, SIGINT = 2, SIGIO = 29, SIGKILL = 9, SIGPIPE = 13, SIGPOLL = 29, SIGPROF = 27, SIGPWR = 30, SIGQUIT = 3, SIGSEGV = 11, SIGSTKFLT = 16, SIGSTOP = 19, SIGSYS = 31, SIGTERM = 15, SIGTRAP = 5, SIGTSTP = 20, SIGTTIN = 21, SIGTTOU = 22, SIGURG = 23, SIGUSR1 = 10, SIGUSR2 = 12, SIGVTALRM = 26, SIGWINCH = 28, SIGXCPU = 24, SIGXFSZ = 25, WNOHANG = 1, WNOWAIT = 16777216, WUNTRACED = 2
ChildProcess
class, constructible
- static methods:
exec(),execSync(),kill(),spawn(),spawnSync() - static values:
SIGABRT = 6,SIGALRM = 14,SIGBUS = 7,SIGCHLD = 17,SIGCONT = 18,SIGFPE = 8,SIGHUP = 1,SIGILL = 4,SIGINT = 2,SIGIO = 29,SIGKILL = 9,SIGPIPE = 13,SIGPOLL = 29,SIGPROF = 27,SIGPWR = 30,SIGQUIT = 3,SIGSEGV = 11,SIGSTKFLT = 16,SIGSTOP = 19,SIGSYS = 31,SIGTERM = 15,SIGTRAP = 5,SIGTSTP = 20,SIGTTIN = 21,SIGTTOU = 22,SIGURG = 23,SIGUSR1 = 10,SIGUSR2 = 12,SIGVTALRM = 26,SIGWINCH = 28,SIGXCPU = 24,SIGXFSZ = 25,WNOHANG = 1,WNOWAIT = 16777216,WUNTRACED = 2 - methods:
kill(),wait(),[Symbol.toPrimitive]() - properties:
exitCode (get),killed (get),onExit (get/set),pid (get),signalCode (get),spawnargs (get),spawnfile (get),stderr (get),stdin (get),stdio (get),stdout (get),[Symbol.toStringTag]
default
class, constructible
- static methods:
exec(),execSync(),kill(),spawn(),spawnSync() - static values:
SIGABRT = 6,SIGALRM = 14,SIGBUS = 7,SIGCHLD = 17,SIGCONT = 18,SIGFPE = 8,SIGHUP = 1,SIGILL = 4,SIGINT = 2,SIGIO = 29,SIGKILL = 9,SIGPIPE = 13,SIGPOLL = 29,SIGPROF = 27,SIGPWR = 30,SIGQUIT = 3,SIGSEGV = 11,SIGSTKFLT = 16,SIGSTOP = 19,SIGSYS = 31,SIGTERM = 15,SIGTRAP = 5,SIGTSTP = 20,SIGTTIN = 21,SIGTTOU = 22,SIGURG = 23,SIGUSR1 = 10,SIGUSR2 = 12,SIGVTALRM = 26,SIGWINCH = 28,SIGXCPU = 24,SIGXFSZ = 25,WNOHANG = 1,WNOWAIT = 16777216,WUNTRACED = 2 - methods:
kill(),wait(),[Symbol.toPrimitive]() - properties:
exitCode (get),killed (get),onExit (get/set),pid (get),signalCode (get),spawnargs (get),spawnfile (get),stderr (get),stdin (get),stdio (get),stdout (get),[Symbol.toStringTag]