File System — Ende namespace

File System APIs for working with files, directories, and file metadata. Includes functions for reading, writing, and manipulating file paths.

Eg Ende.readDir, Ende.readTextFile

  • Ende.chmod — Changes the permission of a specific file/directory of specified path. Ignores the process's umask.
  • Ende.chmodSync — Synchronously changes the permission of a specific file/directory of specified path. Ignores the process's umask.
  • Ende.chown — Change owner of a regular file or directory.
  • Ende.chownSync — Synchronously change owner of a regular file or directory.
  • Ende.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.
  • Ende.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.
  • Ende.create — Creates a file if none exists or truncates an existing file and resolves to an instance of Ende.FsFile.
  • Ende.createSync — Creates a file if none exists or truncates an existing file and returns an instance of Ende.FsFile.
  • Ende.DirEntry — Information about a directory entry returned from Ende.readDir and Ende.readDirSync.
  • Ende.FileInfo — Provides information about a file and is returned by Ende.stat, Ende.lstat, Ende.statSync, and Ende.lstatSync or from calling `stat()` and `statSync()` on an Ende.FsFile instance.
  • Ende.FsEvent — Represents a unique file system event yielded by a Ende.FsWatcher.
  • Ende.FsEventFlag — Additional information for FsEvent objects with the "other" kind.
  • Ende.FsFile — The Ende abstraction for reading and writing files.
  • Ende.FsWatcher — Returned by Ende.watchFs. It is an async iterator yielding up system events. To stop watching the file system by calling `.close()` method.
  • Ende.link — Creates `newpath` as a hard link to `oldpath`.
  • Ende.linkSync — Synchronously creates `newpath` as a hard link to `oldpath`.
  • Ende.lstat — Resolves to a Ende.FileInfo for the specified `path`. If `path` is a symlink, information for the symlink will be returned instead of what it points to.
  • Ende.lstatSync — Synchronously returns a Ende.FileInfo for the specified `path`. If `path` is a symlink, information for the symlink will be returned instead of what it points to.
  • Ende.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.
  • Ende.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.
  • Ende.makeTempFile — Creates a new temporary file in the default directory for temporary files, unless `dir` is specified.
  • Ende.makeTempFileSync — Synchronously creates a new temporary file in the default directory for temporary files, unless `dir` is specified.
  • Ende.MakeTempOptions — Options which can be set when using Ende.makeTempDir, Ende.makeTempDirSync, Ende.makeTempFile, and Ende.makeTempFileSync.
  • Ende.mkdir — Creates a new directory with the specified path.
  • Ende.MkdirOptions — Options which can be set when using Ende.mkdir and Ende.mkdirSync.
  • Ende.mkdirSync — Synchronously creates a new directory with the specified path.
  • Ende.open — Open a file and resolve to an instance of Ende.FsFile. The file does not need to previously exist if using the `create` or `createNew` open options. The caller may have the resulting file automatically closed by the runtime once it's out of scope by declaring the file variable with the `using` keyword.
  • Ende.OpenOptions — Options which can be set when doing Ende.open and Ende.openSync.
  • Ende.openSync — Synchronously open a file and return an instance of Ende.FsFile. The file does not need to previously exist if using the `create` or `createNew` open options. The caller may have the resulting file automatically closed by the runtime once it's out of scope by declaring the file variable with the `using` keyword.
  • Ende.readDir — Reads the directory given by `path` and returns an async iterable of Ende.DirEntry. The order of entries is not guaranteed.
  • Ende.readDirSync — Synchronously reads the directory given by `path` and returns an iterable of Ende.DirEntry. The order of entries is not guaranteed.
  • Ende.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. Rejects with an error when reading a directory.
  • Ende.ReadFileOptions — Options which can be set when using Ende.readFile or Ende.readFileSync.
  • Ende.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. Throws an error when reading a directory.
  • Ende.readLink — Resolves to the full path destination of the named symbolic link.
  • Ende.readLinkSync — Synchronously returns the full path destination of the named symbolic link.
  • Ende.readTextFile — Asynchronously reads and returns the entire contents of a file as an UTF-8 decoded string.
  • Ende.readTextFileSync — Synchronously reads and returns the entire contents of a file as an UTF-8 decoded string.
  • Ende.realPath — Resolves to the absolute normalized path, with symbolic links resolved.
  • Ende.realPathSync — Synchronously returns absolute normalized path, with symbolic links resolved.
  • Ende.remove — Removes the named file or directory.
  • Ende.RemoveOptions — Options which can be set when using Ende.remove and Ende.removeSync.
  • Ende.removeSync — Synchronously removes the named file or directory.
  • Ende.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.
  • Ende.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.
  • Ende.stat — Resolves to a Ende.FileInfo for the specified `path`. Will always follow symlinks.
  • Ende.statSync — Synchronously returns a Ende.FileInfo for the specified `path`. Will always follow symlinks.
  • Ende.symlink — Creates `newpath` as a symbolic link to `oldpath`.
  • Ende.SymlinkOptions — Options that can be used with symlink and symlinkSync.
  • Ende.symlinkSync — Creates `newpath` as a symbolic link to `oldpath`.
  • Ende.truncate — Truncates (or extends) the specified file, to reach the specified `len`. If `len` is not specified then the entire file contents are truncated.
  • Ende.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.
  • Ende.umask — Retrieve the process umask. If `mask` is provided, sets the process umask. This call always returns what the umask was before the call.
  • Ende.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.
  • Ende.utimeSync — Synchronously 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.
  • Ende.watchFs — Watch for file system events against one or more `paths`, which can be files or directories. These paths must exist already. One user action (e.g. `touch test.file`) can generate multiple file system events. Likewise, one user action can result in multiple file paths in one event (e.g. `mv old_name.txt new_name.txt`).
  • Ende.writeFile — Write `data` to the given `path`, by default creating a new file if needed, else overwriting.
  • Ende.WriteFileOptions — Options for writing to a file.
  • Ende.writeFileSync — Synchronously write `data` to the given `path`, by default creating a new file if needed, else overwriting.
  • Ende.writeTextFile — Write string `data` to the given `path`, by default creating a new file if needed, else overwriting.
  • Ende.writeTextFileSync — Synchronously write string `data` to the given `path`, by default creating a new file if needed, else overwriting.