Skip to main content
Deno 2 is finally here 🎉️
Learn more
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
class ChildProcess
extends EventEmitter
import { ChildProcess } from "https://deno.land/std@0.104.0/node/child_process.ts";

Constructors

new
ChildProcess(
command: string,
args?: string[],
options?: ChildProcessOptions,
)

Properties

exitCode: number | null

The exit code of the child process. This property will be null until the child process exits.

killed: boolean

This property is set to true after kill() is called.

pid: number

The PID of this child process.

spawnargs: string[]

Command line arguments given to this child process.

spawnfile: string

The executable file name of this child process.

stderr: Readable | null

This property represents the child process's stderr.

stdin: Writable | null

This property represents the child process's stdin.

stdio: [Writable | null, Readable | null, Readable | null]

Pipes to this child process.

stdout: Readable | null

This property represents the child process's stdout.

Methods

private
_handleError(err: Error): void
private
_waitForChildStreamsToClose(): Promise<void>
kill(signal?: number): boolean
ref(): void
unref(): void