From b84f3efa144d51f0d6c851abbc396088060c08b6 Mon Sep 17 00:00:00 2001 From: Chris Knight Date: Sat, 29 Feb 2020 19:37:32 +0000 Subject: [PATCH] docs: fix broken Deno.write() example (#4190) --- cli/js/files.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/js/files.ts b/cli/js/files.ts index 903564cd15..54c1f26bf8 100644 --- a/cli/js/files.ts +++ b/cli/js/files.ts @@ -167,7 +167,7 @@ export async function read(rid: number, p: Uint8Array): Promise { * * const encoder = new TextEncoder(); * const data = encoder.encode("Hello world\n"); - * const file = Deno.openSync("/foo/bar.txt"); + * const file = Deno.openSync("/foo/bar.txt", {create: true, write: true}); * Deno.writeSync(file.rid, data); */ export function writeSync(rid: number, p: Uint8Array): number { @@ -188,7 +188,7 @@ export function writeSync(rid: number, p: Uint8Array): number { * * const encoder = new TextEncoder(); * const data = encoder.encode("Hello world\n"); - * const file = await Deno.open("/foo/bar.txt"); + * const file = await Deno.open("/foo/bar.txt", {create: true, write: true}); * await Deno.write(file.rid, data); * */