Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Deno.spawnChild

Spawns a child process.

If stdin is set to "piped", the stdin WritableStream needs to be closed manually.

const child = Deno.spawnChild(Deno.execPath(), {
  args: [
    "eval",
    "console.log('Hello World')",
  ],
  stdin: "piped",
});

// open a file and pipe the subprocess output to it.
child.stdout.pipeTo(Deno.openSync("output").writable);

// manually close stdin
child.stdin.close();
const status = await child.status;
function spawnChild<T extends SpawnOptions = SpawnOptions>(command: string | URL, options?: T): Child<T>;
§
spawnChild<T extends SpawnOptions = SpawnOptions>(command: string | URL, options?: T): Child<T>
[src]

§Type Parameters

§Parameters

§
command: string | URL
[src]
§
options?: T optional
[src]

§Return Type