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