function Deno.spawnAndWaitSync
unstable
Overload 1
#spawnAndWaitSync(command: string | URL,options?: CommandOptions,): CommandOutputSynchronously spawns a subprocess, waits for it to finish, and returns the output.
Examples #
#
const { code, stdout } = Deno.spawnAndWaitSync(Deno.execPath(), {
args: ["eval", "console.log('hello')"],
});
console.log(new TextDecoder().decode(stdout)); // "hello\n"
Parameters #
#command: string | URL #options: CommandOptions optional
Return Type #
Overload 2
#spawnAndWaitSync(): CommandOutputSynchronously spawns a subprocess with the given arguments, waits for it to finish, and returns the output.
Examples #
#
const { code, stdout } = Deno.spawnAndWaitSync(
Deno.execPath(),
["eval", "console.log('hello')"],
);
console.log(new TextDecoder().decode(stdout)); // "hello\n"