{ } 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.

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]