node:child_process
Source: lib/node/child_process.js
Node's child_process shapes on top of the native child_process: spawn, spawnSync, exec, execSync, execFile, execFileSync, fork, ChildProcess. Loaded for node:child_process; the bare child_process stays the native module.
import { spawn, execSync } from 'node:child_process';
const c = spawn('ls', ['-l']);
c.stdout.on('data', d => {});
c.on('close', (code, signal) => {});The streams of a child are small EventEmitter objects (data/end, write/end, async iterator), not Node streams: this project does not implement stream.Readable/Writable.
Export list
Generated by utilities/doc-api.js from the node_child_process dump of utilities/api-surface.sh: 26 members. Edit the text above this block, not the block.
Functions: exec(), execFile(), execFileSync(), execSync(), fork(), kill(), spawn(), spawnSync()
ChildProcess
class, constructible
- methods:
_poll(),_spawn(),kill(),ref(),undefined(),unref()
default
object
- static methods:
ChildProcess(),exec(),execFile(),execFileSync(),execSync(),fork(),kill(),spawn(),spawnSync()