summaryrefslogtreecommitdiff
path: root/cli/js
diff options
context:
space:
mode:
authorA.E Clarence <33183127+clarnx@users.noreply.github.com>2020-05-12 17:38:44 +0000
committerGitHub <noreply@github.com>2020-05-12 13:38:44 -0400
commite90c95b465e361a0f06016ad0f16582e7f9a54a6 (patch)
tree631276cfb10ab86d65a790d8d0b74ea54dfbb87a /cli/js
parent053c568c8cba41ae8e296c5bc346db6e75d7816f (diff)
fix example of readTextFile (#5247)
Diffstat (limited to 'cli/js')
-rw-r--r--cli/js/lib.deno.ns.d.ts5
1 files changed, 2 insertions, 3 deletions
diff --git a/cli/js/lib.deno.ns.d.ts b/cli/js/lib.deno.ns.d.ts
index 8c91f145e..931d46455 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<string>;