Skip to content

Commit

Permalink
翻译: Deno.readFileSync (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
fireairforce authored Apr 15, 2020
1 parent a5ae08b commit 427a44b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib.deno.ns.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1271,15 +1271,15 @@ declare namespace Deno {
* Requires `allow-read` and `allow-write` permission. */
export function rename(oldpath: string, newpath: string): Promise<void>;

/** Synchronously reads and returns the entire contents of a file as an array
* of bytes. `TextDecoder` can be used to transform the bytes to string if
* required. Reading a directory returns an empty data array.
/** 同步地读取并将文件的全部内容解析为字节数组。
* `TextDecoder` 可以在需要的情况下可以将字节转换成字符串。
* 读取目录返回一个空的数据数组。
*
* const decoder = new TextDecoder("utf-8");
* const data = Deno.readFileSync("hello.txt");
* console.log(decoder.decode(data));
*
* Requires `allow-read` permission. */
* 需要 `allow-read` 权限。 */
export function readFileSync(path: string): Uint8Array;

/** 读取并将文件的全部内容解析为字节数组。
Expand Down

0 comments on commit 427a44b

Please sign in to comment.