diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2021-02-04 13:09:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-04 13:09:00 +0100 |
commit | 79fa7e0e96ed8261360b90fedcd795ad3a405e44 (patch) | |
tree | e68e402d4e121a4c59ff65766c65fd6521b86305 /cli/dts/lib.deno.ns.d.ts | |
parent | 9069632216235dc92d3f2a4742cae7eb6102915b (diff) |
docs: update example for Deno.Process (#9390)
Diffstat (limited to 'cli/dts/lib.deno.ns.d.ts')
-rw-r--r-- | cli/dts/lib.deno.ns.d.ts | 24 |
1 files changed, 23 insertions, 1 deletions
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<ProcessStatus>; /** Buffer the stdout until EOF and return it as `Uint8Array`. * |