diff --git a/doc/api/fs.md b/doc/api/fs.md index d3421a0ff01b..2b468b982a32 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -1188,6 +1188,10 @@ changes: Calls `filehandle.close()` and returns a promise that fulfills when the filehandle is closed. +This method enables the filehandle to be used with [`await using`][], which +will automatically close the file when the scope exits. For more information, +see the [MDN documentation on `using` statements][`using`]. + ### `fsPromises.access(path[, mode])` +See the [MDN documentation on `using` statements][`using`] for more information about +explicit resource management. For detailed information, see the documentation of [`fsPromises.mkdtemp()`][]. @@ -6430,12 +6435,13 @@ removed if it still exists. If the directory cannot be deleted, disposal will throw an error. The object has a `remove()` method which will perform the same task. - +See the [MDN documentation on `using` statements][`using`] for more information about +explicit resource management. For detailed information, see the documentation of [`fs.mkdtemp()`][]. There is no callback-based version of this API because it is designed for use -with the `using` syntax. +with the [`using`][] syntax. The optional `options` argument can be a string specifying an encoding, or an object with an `encoding` property specifying the character encoding to use. @@ -7307,6 +7313,10 @@ changes: Calls `dir.close()` if the directory handle is open, and returns a promise that fulfills when disposal is complete. +This method enables the directory to be used with [`await using`][], which +will automatically close the directory when the scope exits. For more +information, see the [MDN documentation on `using` statements][`using`]. + #### `dir[Symbol.dispose]()`