Skip to main content
Home
Works with
It is unknown whether this package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
It is unknown whether this package works with Deno
It is unknown whether this package works with Bun
It is unknown whether this package works with Browsers
JSR Score76%
Published10 months ago (0.0.9)

default

Helpers for working with the filesystem.

f
copy

Asynchronously copy a file or directory (along with its contents), like cp -r.

I
CopyOptions

Options for copy and copySync.

f
copySync

Synchronously copy a file or directory (along with its contents), like cp -r.

v
CRLF

End-of-line character for Windows platforms.

f
detect

Returns the detected EOL character(s) detected in the input string. If no EOL character is detected, null is returned.

f
emptyDir

Asynchronously ensures that a directory is empty.

f
emptyDirSync

Synchronously ensures that a directory is empty deletes the directory contents it is not empty.

f
ensureDir

Asynchronously ensures that the directory exists, like mkdir -p.

f
ensureDirSync

Synchronously ensures that the directory exists, like mkdir -p.

f
ensureFile

Asynchronously ensures that the file exists.

f
ensureFileSync

Synchronously ensures that the file exists.

f
ensureLinkSync

Synchronously ensures that the hard link exists.

f
ensureSymlinkSync

Synchronously ensures that the link exists, and points to a valid file.

v
EOL

End-of-line character evaluated for the current platform.

f
exists

Asynchronously test whether or not the given path exists by checking with the file system.

I
ExistsOptions

Options for exists and existsSync.

f
existsSync

Synchronously test whether or not the given path exists by checking with the file system.

f
expandGlob

Returns an async iterator that yields each file path matching the given glob pattern.

I
ExpandGlobOptions

Options for expandGlob and expandGlobSync.

f
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.

f
format

Normalize the input string to the targeted EOL.

v
LF

End-of-line character for POSIX platforms such as macOS and Linux.

f
move

Asynchronously moves a file or directory (along with its contents).

I
MoveOptions

Options for move and moveSync.

f
moveSync

Synchronously moves a file or directory (along with its contents).

f
walk

Recursively walks through a directory and yields information about each file and directory encountered.

f
walkSync

Recursively walks through a directory and yields information about each file and directory encountered.

f
copy

Asynchronously copy a file or directory (along with its contents), like cp -r.

I
CopyOptions

Options for copy and copySync.

f
copySync

Synchronously copy a file or directory (along with its contents), like cp -r.

f
emptyDir

Asynchronously ensures that a directory is empty.

f
emptyDirSync

Synchronously ensures that a directory is empty deletes the directory contents it is not empty.

f
ensureDir

Asynchronously ensures that the directory exists, like mkdir -p.

f
ensureDirSync

Synchronously ensures that the directory exists, like mkdir -p.

f
ensureFile

Asynchronously ensures that the file exists.

f
ensureFileSync

Synchronously ensures that the file exists.

v
CRLF

End-of-line character for Windows platforms.

f
detect

Returns the detected EOL character(s) detected in the input string. If no EOL character is detected, null is returned.

v
EOL

End-of-line character evaluated for the current platform.

f
format

Normalize the input string to the targeted EOL.

v
LF

End-of-line character for POSIX platforms such as macOS and Linux.

f
exists

Asynchronously test whether or not the given path exists by checking with the file system.

I
ExistsOptions

Options for exists and existsSync.

f
existsSync

Synchronously test whether or not the given path exists by checking with the file system.

f
expandGlob

Returns an async iterator that yields each file path matching the given glob pattern.

I
ExpandGlobOptions

Options for expandGlob and expandGlobSync.

f
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.

I
WalkEntry

Walk entry for walk, walkSync, expandGlob and expandGlobSync.

f
move

Asynchronously moves a file or directory (along with its contents).

I
MoveOptions

Options for move and moveSync.

f
moveSync

Synchronously moves a file or directory (along with its contents).

f
chmod

Changes the permission of a specific file/directory of specified path. Ignores the process's umask.

f
chmodSync

Synchronously changes the permission of a specific file/directory of specified path. Ignores the process's umask.

f
copyFile

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.

f
copyFileSync

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.

f
lstat

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.

f
lstatSync

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.

f
makeTempDir

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.

f
makeTempDirSync

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.

f
makeTempFile

Creates a new temporary file in the default directory for temporary files, unless dir is specified.

f
makeTempFileSync

Synchronously creates a new temporary file in the default directory for temporary files, unless dir is specified.

f
mkdir

Creates a new directory with the specified path.

I
MkdirOptions

Options which can be set when using mkdir and mkdirSync.

f
mkdirSync

Synchronously creates a new directory with the specified path.

f
readDir

Reads the directory given by path and returns an async iterable of DirEntry. The order of entries is not guaranteed.

f
readDirSync

Reads the directory given by path and returns an async iterable of DirEntry. The order of entries is not guaranteed.

f
readFile

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.

f
readFileSync

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.

f
readTextFile

Asynchronously reads and returns the entire contents of a file as an UTF-8 decoded string.

f
readTextFileSync

Synchronously reads and returns the entire contents of a file as an UTF-8 decoded string.

f
realPath

Resolves to the absolute normalized path, with symbolic links resolved.

f
realPathSync

Synchronously returns absolute normalized path, with symbolic links resolved.

f
remove

Removes the named file or directory.

f
removeSync

Synchronously removes the named file or directory.

f
rename

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.

f
renameSync

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.

f
stat

Resolves to a FileInfo for the specified path. Will always follow symlinks.

f
statSync

Synchronously returns a FileInfo for the specified path. Will always follow symlinks.

f
truncate

Truncates (or extends) the specified file, to reach the specified len. If len is not specified then the entire file contents are truncated.

f
truncateSync

Synchronously truncates (or extends) the specified file, to reach the specified len. If len is not specified then the entire file contents are truncated.

I
DirEntry

Information about a directory entry returned from readDir and readDirSync.

I
FileInfo

Provides information about a file and is returned by stat, lstat, statSync, and lstatSync or from calling stat() and statSync() on an FsFile instance.

I
MakeTempOptions

Options which can be set when using makeTempDir, makeTempDirSync, makeTempFile, and makeTempFileSync.

I
ReadFileOptions

Options which can be set when using readFile or readTextFile.

I
RemoveOptions

Options that can be used with remove and removeSync.

I
SymlinkOptions

Options that can be used with symlink and symlinkSync.

I
WriteFileOptions

Options for writing to a file.

f
umask

Retrieve the process umask. If mask is provided, sets the process umask. This call always returns what the umask was before the call.

f
utime

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.

f
utimeSync

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.

f
writeFile

Write data to the given path, by default creating a new file if needed, else overwriting.

f
writeFileSync

Synchronously write data to the given path, by default creating a new file if needed, else overwriting.

f
writeTextFile

Write string data to the given path, by default creating a new file if needed, else overwriting.

f
writeTextFileSync

Synchronously write string data to the given path, by default creating a new file if needed, else overwriting.

f
walk

Recursively walks through a directory and yields information about each file and directory encountered.

f
walkSync

Recursively walks through a directory and yields information about each file and directory encountered.

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.