From 79fa7e0e96ed8261360b90fedcd795ad3a405e44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 4 Feb 2021 13:09:00 +0100 Subject: docs: update example for Deno.Process (#9390) --- cli/dts/lib.deno.ns.d.ts | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'cli/dts/lib.deno.ns.d.ts') diff --git a/cli/dts/lib.deno.ns.d.ts b/cli/dts/lib.deno.ns.d.ts index f8ec0c7f3..b607554e1 100644 --- a/cli/dts/lib.deno.ns.d.ts +++ b/cli/dts/lib.deno.ns.d.ts @@ -1910,7 +1910,29 @@ declare namespace Deno { : (Reader & Closer) | null; readonly stderr: T["stderr"] extends "piped" ? Reader & Closer : (Reader & Closer) | null; - /** Resolves to the current status of the process. */ + /** Wait for the process to exit and return its exit status. + * + * Calling this function multiple times will return the same status. + * + * Stdin handle to the process will be closed before waiting to avoid + * a deadlock. + * + * If `stdout` and/or `stderr` were set to `"piped"`, they must be closed + * manually before the process can exit. + * + * To run process to completion and collect output from both `stdout` and + * `stderr` use: + * + * ```ts + * const p = Deno.run({ cmd, stderr: 'piped', stdout: 'piped' }); + * const [status, stdout, stderr] = await Promise.all([ + * p.status(), + * p.output(), + * p.stderrOutput() + * ]); + * p.close(); + * ``` + **/ status(): Promise; /** Buffer the stdout until EOF and return it as `Uint8Array`. * -- cgit v1.2.3