import * as mod from "https://deno.land/std@0.224.0/fs/mod.ts";
Helpers for working with the filesystem.
import { ensureFile, copy, ensureDir, move } from "https://deno.land/std@0.224.0/fs/mod.ts";
await ensureFile("example.txt");
await copy("example.txt", "example_copy.txt");
await ensureDir("subdir");
await move("example_copy.txt", "subdir/example_copy.txt");
Variables
v CRLF | End-of-line character for Windows platforms. |
v EOL | End-of-line character evaluated for the current platform. |
v LF | End-of-line character for POSIX platforms such as macOS and Linux. |
Functions
f copy | Asynchronously copy a file or directory. The directory can have contents.
Like |
Synchronously copy a file or directory. The directory can have contents.
Like | |
Returns the detected EOL character(s) detected in the input string. If no EOL
character is detected, | |
Asynchronously ensures that a directory is empty deletes the directory contents it is not empty. If the directory does not exist, it is created. The directory itself is not deleted. | |
Synchronously ensures that a directory is empty deletes the directory contents it is not empty. If the directory does not exist, it is created. The directory itself is not deleted. | |
Asynchronously ensures that the directory exists. If the directory structure
does not exist, it is created. Like | |
Synchronously ensures that the directory exists. If the directory structure
does not exist, it is created. Like | |
Asynchronously ensures that the file exists. If the file that is requested to be created is in directories that do not exist, these directories are created. If the file already exists, it is not modified. | |
Synchronously ensures that the file exists. If the file that is requested to be created is in directories that do not exist, these directories are created. If the file already exists, it is not modified. | |
Asynchronously ensures that the hard link exists. If the directory structure does not exist, it is created. | |
Synchronously ensures that the hard link exists. If the directory structure does not exist, it is created. | |
Asynchronously ensures that the link exists, and points to a valid file. If the directory structure does not exist, it is created. If the link already exists, it is not modified but error is thrown if it is not point to the given target. | |
Synchronously ensures that the link exists, and points to a valid file. If the directory structure does not exist, it is created. If the link already exists, it is not modified but error is thrown if it is not point to the given target. | |
Asynchronously test whether or not the given path exists by checking with the file system. | |
Synchronously test whether or not the given path exists by checking with the file system. | |
Returns an async iterator that yields each file path matching the given glob
pattern. The file paths are relative to the provided | |
Returns an iterator that yields each file path matching the given glob
pattern. The file paths are relative to the provided | |
Normalize the input string to the targeted EOL. | |
f move | Asynchronously moves a file or directory. |
Synchronously moves a file or directory. | |
f walk | Recursively walks through a directory and yields information about each file and directory encountered. |
Same as |
Interfaces
Options for | |
Options for | |
Options for | |
Walk entry for | |