summaryrefslogtreecommitdiff
path: root/cli/js/read_file.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/js/read_file.ts')
-rw-r--r--cli/js/read_file.ts14
1 files changed, 0 insertions, 14 deletions
diff --git a/cli/js/read_file.ts b/cli/js/read_file.ts
index 43372ca45..317401af5 100644
--- a/cli/js/read_file.ts
+++ b/cli/js/read_file.ts
@@ -2,13 +2,6 @@
import { open, openSync } from "./files.ts";
import { readAll, readAllSync } from "./buffer.ts";
-/** Reads and returns the entire contents of a file.
- *
- * const decoder = new TextDecoder("utf-8");
- * const data = Deno.readFileSync("hello.txt");
- * console.log(decoder.decode(data));
- *
- * Requires `allow-read` permission. */
export function readFileSync(path: string): Uint8Array {
const file = openSync(path);
const contents = readAllSync(file);
@@ -16,13 +9,6 @@ export function readFileSync(path: string): Uint8Array {
return contents;
}
-/** Reads and resolves to the entire contents of a file.
- *
- * const decoder = new TextDecoder("utf-8");
- * const data = await Deno.readFile("hello.txt");
- * console.log(decoder.decode(data));
- *
- * Requires `allow-read` permission. */
export async function readFile(path: string): Promise<Uint8Array> {
const file = await open(path);
const contents = await readAll(file);