diff --git a/doc/api/fs.md b/doc/api/fs.md index c0c88a3abb90c1..2eb4739ed5084e 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -253,6 +253,19 @@ try { } ``` +```cjs +const { open } = require('node:fs/promises'); + +(async () => { + let filehandle; + try { + filehandle = await open('thefile.txt', 'r'); + } finally { + await filehandle?.close(); + } +})(); +``` + #### `filehandle.createReadStream([options])`