summaryrefslogtreecommitdiff
path: root/cli/js/write_file.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/js/write_file.ts')
-rw-r--r--cli/js/write_file.ts24
1 files changed, 0 insertions, 24 deletions
diff --git a/cli/js/write_file.ts b/cli/js/write_file.ts
index 995335f57..5227bfece 100644
--- a/cli/js/write_file.ts
+++ b/cli/js/write_file.ts
@@ -4,27 +4,12 @@ import { open, openSync } from "./files.ts";
import { chmod, chmodSync } from "./ops/fs/chmod.ts";
import { writeAll, writeAllSync } from "./buffer.ts";
-/** Options for writing to a file. */
export interface WriteFileOptions {
- /** Defaults to `false`. If set to `true`, will append to a file instead of
- * overwriting previous contents. */
append?: boolean;
- /** Sets the option to allow creating a new file, if one doesn't already
- * exist at the specified path (defaults to `true`). */
create?: boolean;
- /** Permissions always applied to file. */
mode?: number;
}
-/** Synchronously write data to the given path, by default creating a new
- * file if needed, else overwriting.
- *
- * const encoder = new TextEncoder();
- * const data = encoder.encode("Hello world\n");
- * Deno.writeFileSync("hello.txt", data);
- *
- * Requires `allow-write` permission, and `allow-read` if create is `false`.
- */
export function writeFileSync(
path: string,
data: Uint8Array,
@@ -49,15 +34,6 @@ export function writeFileSync(
file.close();
}
-/** Write data to the given path, by default creating a new file if needed,
- * else overwriting.
- *
- * const encoder = new TextEncoder();
- * const data = encoder.encode("Hello world\n");
- * await Deno.writeFile("hello.txt", data);
- *
- * Requires `allow-write` permission, and `allow-read` if create is `false`.
- */
export async function writeFile(
path: string,
data: Uint8Array,