@@ -1183,6 +1183,10 @@ changes:
11831183Calls ` filehandle .close ()` and returns a promise that fulfills when the
11841184filehandle is closed.
11851185
1186+ This method enables the filehandle to be used with [` await using` ][], which
1187+ will automatically close the file when the scope exits. For more information,
1188+ see the [MDN documentation on ` using` statements][` using` ].
1189+
11861190### ` fsPromises .access (path[, mode])`
11871191
11881192<!-- YAML
@@ -1661,10 +1665,11 @@ directory cannot be deleted, disposal will throw an error. The object has an
16611665async ` remove ()` method which will perform the same task.
16621666
16631667Both this function and the disposal function on the resulting object are
1664- async, so it should be used with ` await ` + ` await using` as in
1668+ async, so it should be used with ` await ` + [ ` await using` ][] as in
16651669` await using dir = await fsPromises .mkdtempDisposable (' prefix' )` .
16661670
1667- <!-- TODO: link MDN docs for disposables once https://github.com/mdn/content/pull/38027 lands -->
1671+ See the [MDN documentation on ` using` statements][` using` ] for more information about
1672+ explicit resource management.
16681673
16691674For detailed information, see the documentation of [` fsPromises .mkdtemp ()` ][].
16701675
@@ -6393,12 +6398,13 @@ removed if it still exists. If the directory cannot be deleted, disposal will
63936398throw an error. The object has a ` remove ()` method which will perform the same
63946399task.
63956400
6396- <!-- TODO: link MDN docs for disposables once https://github.com/mdn/content/pull/38027 lands -->
6401+ See the [MDN documentation on ` using` statements][` using` ] for more information about
6402+ explicit resource management.
63976403
63986404For detailed information, see the documentation of [` fs .mkdtemp ()` ][].
63996405
64006406There is no callback-based version of this API because it is designed for use
6401- with the ` using` syntax.
6407+ with the [ ` using` ][] syntax.
64026408
64036409The optional ` options` argument can be a string specifying an encoding, or an
64046410object with an ` encoding` property specifying the character encoding to use.
@@ -7273,6 +7279,10 @@ changes:
72737279Calls ` dir .close ()` if the directory handle is open, and returns a promise that
72747280fulfills when disposal is complete.
72757281
7282+ This method enables the directory to be used with [` await using` ][], which
7283+ will automatically close the directory when the scope exits. For more
7284+ information, see the [MDN documentation on ` using` statements][` using` ].
7285+
72767286#### ` dir[Symbol .dispose ]()`
72777287
72787288<!-- YAML
@@ -7286,6 +7296,10 @@ changes:
72867296Calls ` dir .closeSync ()` if the directory handle is open, and returns
72877297` undefined ` .
72887298
7299+ This method enables the directory to be used with [` using` ][], which
7300+ will automatically close the directory when the scope exits. For more
7301+ information, see the [MDN documentation on ` using` statements][` using` ].
7302+
72897303### Class: ` fs .Dirent `
72907304
72917305<!-- YAML
@@ -8397,6 +8411,10 @@ the `data` argument must be a {Buffer}.
83978411
83988412Calls ` utf8Stream .destroy ()` .
83998413
8414+ This method enables the stream to be used with [` using` ][], which
8415+ will automatically destroy the stream when the scope exits. For more
8416+ information, see the [MDN documentation on ` using` statements][` using` ].
8417+
84008418### Class: ` fs .WriteStream `
84018419
84028420<!-- YAML
@@ -9213,6 +9231,7 @@ the file contents.
92139231[` Number .MAX_SAFE_INTEGER ` ]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER
92149232[` ReadDirectoryChangesW` ]: https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-readdirectorychangesw
92159233[` UV_THREADPOOL_SIZE ` ]: cli.md#uv_threadpool_sizesize
9234+ [` await using` ]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/await_using
92169235[` event ports` ]: https://illumos.org/man/port_create
92179236[` filehandle .createReadStream ()` ]: #filehandlecreatereadstreamoptions
92189237[` filehandle .createWriteStream ()` ]: #filehandlecreatewritestreamoptions
@@ -9272,6 +9291,7 @@ the file contents.
92729291[` stream/ iter pipeTo ()` ]: stream_iter.md#pipetosource-transforms-writer-options
92739292[` stream/ iter pull ()` ]: stream_iter.md#pullsource-transforms-options
92749293[` stream/ iter pullSync ()` ]: stream_iter.md#pullsyncsource-transforms
9294+ [` using` ]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/using
92759295[` util .promisify ()` ]: util.md#utilpromisifyoriginal
92769296[bigints]: https://tc39.github.io/proposal-bigint
92779297[caveats]: #caveats
0 commit comments