node:child_process
Node.js child_process module, resolvable via both ESM import and CommonJS
require (with or without the node: prefix).
Elide registers node:child_process as a built-in shim (NodeChildProcessModule),
but its entry points are not yet implemented: every function throws an error
whose code is ERR_METHOD_NOT_IMPLEMENTED. Native process creation is planned
but not yet wired up. Importing the module succeeds; calling into it does not.
Status
| Export | Behaviour |
|---|---|
spawn, spawnSync | Throw ERR_METHOD_NOT_IMPLEMENTED |
exec, execSync | Throw ERR_METHOD_NOT_IMPLEMENTED |
execFile, execFileSync | Throw ERR_METHOD_NOT_IMPLEMENTED |
fork | Throws ERR_METHOD_NOT_IMPLEMENTED |
ChildProcess (constructor) | Throws ERR_METHOD_NOT_IMPLEMENTED |
JavaScriptLang.initAllModules() and backed by an
embedded shim (elide/js/node_child_process.js); the shim's entry points all
raise coded ERR_METHOD_NOT_IMPLEMENTED errors until host subprocess support
lands.
Example
import { spawn } from "node:child_process";
// The import resolves, but the call throws:
try {
spawn("ls");
} catch (err) {
err.code; // → "ERR_METHOD_NOT_IMPLEMENTED"
}Host process primitives (not wired here)
Elide ships a host-internal process layer in
dev.elide.lang.javascript.process.host (ProcessPrimitives,
ProcessPrimitivesAsync, ProcessSignals, Stdio, Tty, Pty,
ProcessException) — see Process primitives.
These primitives are designed as the eventual backing for a native
child_process, but they are not yet connected to node:child_process.
Specified surface (WebIDL contract)
A WebIDL contract for the module exists at
protocol/webidl/node/child_process.webidl, and codegen emits an abstract
namespace base plus a SpawnSyncResult dictionary. It describes the target
API surface — execSync, execFileSync, spawnSync, exec, execFile,
spawn, and fork (the last without a planned IPC channel) — for a future
native implementation. No concrete class implements that base yet, and the
@compat markers reflect intended, not present, compatibility.
See also
- Process primitives (host-internal) — the
process.hostlayer intended to back a future native implementation. - Node.js upstream: