default
Helpers for working with the filesystem.
End-of-line character for Windows platforms.
Returns the detected EOL character(s) detected in the input string. If no EOL
character is detected, null is returned.
Asynchronously ensures that a directory is empty.
Synchronously ensures that a directory is empty deletes the directory contents it is not empty.
Synchronously ensures that the directory exists, like
mkdir -p.
Asynchronously ensures that the file exists.
Synchronously ensures that the file exists.
Asynchronously ensures that the hard link exists.
Synchronously ensures that the hard link exists.
Asynchronously ensures that the link exists, and points to a valid file.
Synchronously ensures that the link exists, and points to a valid file.
End-of-line character evaluated for the current platform.
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.
Options for expandGlob and expandGlobSync.
Returns an iterator that yields each file path matching the given glob
pattern. The file paths are relative to the provided root directory.
If root is not provided, the current working directory is used.
The root directory is not included in the yielded file paths.
Normalize the input string to the targeted EOL.
End-of-line character for POSIX platforms such as macOS and Linux.
Asynchronously moves a file or directory (along with its contents).
Synchronously moves a file or directory (along with its contents).
Recursively walks through a directory and yields information about each file and directory encountered.
Options for walk and walkSync.
Recursively walks through a directory and yields information about each file and directory encountered.
Asynchronously ensures that a directory is empty.
Synchronously ensures that a directory is empty deletes the directory contents it is not empty.
Synchronously ensures that the directory exists, like
mkdir -p.
Asynchronously ensures that the file exists.
Synchronously ensures that the file exists.
Asynchronously ensures that the hard link exists.
Synchronously ensures that the hard link exists.
Asynchronously ensures that the link exists, and points to a valid file.
Synchronously ensures that the link exists, and points to a valid file.
End-of-line character for Windows platforms.
Returns the detected EOL character(s) detected in the input string. If no EOL
character is detected, null is returned.
End-of-line character evaluated for the current platform.
Normalize the input string to the targeted EOL.
End-of-line character for POSIX platforms such as macOS and Linux.
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.
Options for expandGlob and expandGlobSync.
Returns an iterator that yields each file path matching the given glob
pattern. The file paths are relative to the provided root directory.
If root is not provided, the current working directory is used.
The root directory is not included in the yielded file paths.
Copies the contents and permissions of one file to another specified path, by default creating a new file if needed, else overwriting. Fails if target path is a directory or is unwritable.
Synchronously copies the contents and permissions of one file to another specified path, by default creating a new file if needed, else overwriting. Fails if target path is a directory or is unwritable.
Resolves to a FileInfo for the specified path. If path is a symlink, information for the symlink will be returned instead of what it points to.
Synchronously returns a FileInfo for the specified
path. If path is a symlink, information for the symlink will be
returned instead of what it points to.
Creates a new temporary directory in the default directory for temporary
files, unless dir is specified. Other optional options include
prefixing and suffixing the directory name with prefix and suffix
respectively.
Synchronously creates a new temporary directory in the default directory
for temporary files, unless dir is specified. Other optional options
include prefixing and suffixing the directory name with prefix and
suffix respectively.
Creates a new temporary file in the default directory for temporary files,
unless dir is specified.
Synchronously creates a new temporary file in the default directory for
temporary files, unless dir is specified.
Reads the directory given by path and returns an async iterable of
DirEntry. The order of entries is not guaranteed.
Reads the directory given by path and returns an async iterable of
DirEntry. The order of entries is not guaranteed.
Reads and resolves to the entire contents of a file as an array of bytes.
TextDecoder can be used to transform the bytes to string if required.
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.
Resolves to the path destination of the named symbolic link.
Synchronously returns the path destination of the named symbolic link.
Asynchronously reads and returns the entire contents of a file as an UTF-8 decoded string.
Synchronously reads and returns the entire contents of a file as an UTF-8 decoded string.
Resolves to the absolute normalized path, with symbolic links resolved.
Synchronously returns absolute normalized path, with symbolic links resolved.
Removes the named file or directory.
Synchronously removes the named file or directory.
Renames (moves) oldpath to newpath. Paths may be files or directories.
If newpath already exists and is not a directory, rename() replaces it.
OS-specific restrictions may apply when oldpath and newpath are in
different directories.
Synchronously renames (moves) oldpath to newpath. Paths may be files or
directories. If newpath already exists and is not a directory,
renameSync() replaces it. OS-specific restrictions may apply when
oldpath and newpath are in different directories.
Creates newpath as a symbolic link to oldpath.
Creates newpath as a symbolic link to oldpath.
Truncates (or extends) the specified file, to reach the specified len. If
len is not specified then the entire file contents are truncated.
Synchronously truncates (or extends) the specified file, to reach the
specified len. If len is not specified then the entire file contents are
truncated.
Information about a directory entry returned from readDir
and readDirSync.
Options which can be set when using makeTempDir,
makeTempDirSync, makeTempFile, and
makeTempFileSync.
Retrieve the process umask. If mask is provided, sets the process umask.
This call always returns what the umask was before the call.
Changes the access (atime) and modification (mtime) times of a file
system object referenced by path. Given times are either in seconds
(UNIX epoch time) or as Date objects.
Synchronously changes the access (atime) and modification (mtime)
times of the file stream resource. Given times are either in seconds
(UNIX epoch time) or as Date objects.
Write data to the given path, by default creating a new file if needed,
else overwriting.
Synchronously write data to the given path, by default creating a new
file if needed, else overwriting.
Write string data to the given path, by default creating a new file if
needed, else overwriting.
Synchronously write string data to the given path, by default creating
a new file if needed, else overwriting.
Recursively walks through a directory and yields information about each file and directory encountered.
Options for walk and walkSync.
Recursively walks through a directory and yields information about each file and directory encountered.