From e90c95b465e361a0f06016ad0f16582e7f9a54a6 Mon Sep 17 00:00:00 2001 From: "A.E Clarence" <33183127+clarnx@users.noreply.github.com> Date: Tue, 12 May 2020 17:38:44 +0000 Subject: [PATCH] fix example of readTextFile (#5247) --- cli/js/lib.deno.ns.d.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cli/js/lib.deno.ns.d.ts b/cli/js/lib.deno.ns.d.ts index 8c91f145e371d..931d464553a32 100644 --- a/cli/js/lib.deno.ns.d.ts +++ b/cli/js/lib.deno.ns.d.ts @@ -1031,9 +1031,8 @@ declare namespace Deno { /** Asynchronously reads and returns the entire contents of a file as a utf8 * encoded string. Reading a directory returns an empty data array. * - * const decoder = new TextDecoder("utf-8"); - * const data = Deno.readFileSync("hello.txt"); - * console.log(decoder.decode(data)); + * const data = await Deno.readTextFile("hello.txt"); + * console.log(data); * * Requires `allow-read` permission. */ export function readTextFile(path: string): Promise;