Standard library / child_process · on the one-page reference
child_process
Experimental — new, manually tested rather than conformance-suite covered.
A first, sync-only slice of
Node's
child_process module: the biggest capability gap in the
stdlib closed so far, since Lumen programs previously couldn't invoke
another program at all.
child_process.spawnSync(command, args) Wasm: limited
(string, string[]) → { stdout, stderr, status }
— runs command with args (no shell
involved, matching Node's real spawnSync, not
execSync's shell-string form -- safer by default, no
shell-quoting needed), waits for it to exit. status is
-1 if the command could not even be spawned (e.g. not
found).
const r = child_process.spawnSync("echo", ["hello", "world"]);
console.log(r.stdout); // hello world
console.log(r.status); // 0