mirror of
https://github.com/denoland/deno.git
synced 2024-10-29 08:58:01 -04:00
docs: update example for Deno.Process (#9390)
This commit is contained in:
parent
9069632216
commit
79fa7e0e96
1 changed files with 23 additions and 1 deletions
24
cli/dts/lib.deno.ns.d.ts
vendored
24
cli/dts/lib.deno.ns.d.ts
vendored
|
@ -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`.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue