1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-24 15:19:26 -05:00

docs: correct example of piping the output of a subprocess to a file (#18933)

Fixes #18909
This commit is contained in:
Michael Lazarev 2023-05-02 00:52:56 +03:00 committed by GitHub
parent 913176313b
commit 2ee55145c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4003,11 +4003,14 @@ declare namespace Deno {
* "console.log('Hello World')",
* ],
* stdin: "piped",
* stdout: "piped",
* });
* const child = command.spawn();
*
* // open a file and pipe the subprocess output to it.
* child.stdout.pipeTo(Deno.openSync("output").writable);
* child.stdout.pipeTo(
* Deno.openSync("output", { write: true, create: true }).writable,
* );
*
* // manually close stdin
* child.stdin.close();