Skip to content

Commit

Permalink
fix example of readTextFile (denoland#5247)
Browse files Browse the repository at this point in the history
  • Loading branch information
clarnx committed May 12, 2020
1 parent 053c568 commit e90c95b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cli/js/lib.deno.ns.d.ts
Expand Up @@ -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>;
Expand Down

0 comments on commit e90c95b

Please sign in to comment.