1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-27 01:29:14 -05:00

docs(cli/dts): use one block per writeAll example (#10496)

This commit is contained in:
Casper Beyer 2021-05-05 13:55:21 +08:00 committed by GitHub
parent 9c206545f7
commit a16a830e33
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -989,13 +989,17 @@ declare namespace Deno {
* // Example writing to stdout
* const contentBytes = new TextEncoder().encode("Hello World");
* await Deno.writeAll(Deno.stdout, contentBytes);
* ```
*
* ```ts
* // Example writing to file
* const contentBytes = new TextEncoder().encode("Hello World");
* const file = await Deno.open('test.file', {write: true});
* await Deno.writeAll(file, contentBytes);
* Deno.close(file.rid);
* ```
*
* ```ts
* // Example writing to buffer
* const contentBytes = new TextEncoder().encode("Hello World");
* const writer = new Deno.Buffer();
@ -1015,13 +1019,17 @@ declare namespace Deno {
* // Example writing to stdout
* const contentBytes = new TextEncoder().encode("Hello World");
* Deno.writeAllSync(Deno.stdout, contentBytes);
* ```
*
* ```ts
* // Example writing to file
* const contentBytes = new TextEncoder().encode("Hello World");
* const file = Deno.openSync('test.file', {write: true});
* Deno.writeAllSync(file, contentBytes);
* Deno.close(file.rid);
* ```
*
* ```ts
* // Example writing to buffer
* const contentBytes = new TextEncoder().encode("Hello World");
* const writer = new Deno.Buffer();