Expand description
Bindings to the Node.js fs and fs/promises modules for file system access.
Structs§
- Fs
- Binding to the Node.js
fsmodule, exposing the synchronous (*Sync) file system API. - FsPromises
- Binding to the Node.js
fs/promisesmodule, exposing the promise-based (asynchronous) file system API.
Functions§
- exists_
sync - Synchronously returns
trueif a file system entry exists atpath. - mkdir_
sync - Synchronously creates the directory at
path, honouring the supplied options (e.g.recursive,mode). - read_
file_ sync - Synchronously reads and returns the contents of the file at
path. The returned value is aBuffer, or a string when anencodingis given inoptions. - readdir
- Asynchronously reads the contents of the directory at
path, returning an array of the names of the entries it contains. - readdir_
sync - Reads the contents of the directory at
path, delivering the resulting entries to the supplied JavaScriptcallback. - readdir_
with_ options - Asynchronously reads the contents of the directory at
path, applying the given options (e.g.withFileTypes,recursive,encoding). - rename_
sync - Synchronously renames (moves) the file or directory from
fromtoto. - stat_
sync - Synchronously retrieves the
fs.Statsobject describing the file system entry atpath. - unlink_
sync - Synchronously removes the file (or symbolic link) at
path. - write_
file_ sync - Synchronously writes
datato the file atpath, creating or replacing it according to the supplied options (e.g.encoding,mode,flag).