Skip to main content
function Deno.spawnSync

Synchronously executes a subprocess, waiting for it to finish and collecting all of its output. The stdio options are ignored.

const { status, stdout, stderr } = Deno.spawnSync(Deno.execPath(), { args: [ "eval", "console.log('hello'); console.error('world')", ], }); console.assert(status.code === 0); console.assert("hello\n" === new TextDecoder().decode(stdout)); console.assert("world\n" === new TextDecoder().decode(stderr));

Type Parameters

optional
T extends SpawnOptions = SpawnOptions

Parameters

command: string | URL
optional
options: T

Returns

SpawnOutput<T>