0
0
Fork 0
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:
Bartek Iwańczuk 2021-02-04 13:09:00 +01:00 committed by GitHub
parent 9069632216
commit 79fa7e0e96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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`.
*