0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-02-13 01:06:00 -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 Levente Kurusa
parent 9c646ac6ed
commit fae7643648
No known key found for this signature in database
GPG key ID: 9F72F3C05BA137C4

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();