1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-08 15:19:40 -05:00

docs(cli/dts): add missing awaits (#10501)

This commit is contained in:
Casper Beyer 2021-05-05 13:59:12 +08:00 committed by GitHub
parent d654e78e0d
commit 49c4d57b0f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2401,13 +2401,13 @@ declare namespace Deno {
*
* ```ts
* // truncate the entire file
* const file = Deno.open("my_file.txt", { read: true, write: true, create: true });
* const file = await Deno.open("my_file.txt", { read: true, write: true, create: true });
* await Deno.ftruncate(file.rid);
* ```
*
* ```ts
* // truncate part of the file
* const file = Deno.open("my_file.txt", { read: true, write: true, create: true });
* const file = await Deno.open("my_file.txt", { read: true, write: true, create: true });
* await Deno.write(file.rid, new TextEncoder().encode("Hello World"));
* await Deno.ftruncate(file.rid, 7);
* const data = new Uint8Array(32);