diff --git a/doc/api/fs.md b/doc/api/fs.md index 1e41b80c36cc75..f3e8e8c40bc2ff 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -499,15 +499,15 @@ Convenient alias to create a `readline` interface and stream over the file. See ```mjs import { open } from 'node:fs/promises'; -let fh; +let file; try { - fh = await open(new URL(import.meta.url)); + file = await open('./some/file/to/read'); - for await (const line of fh.readLines()) { + for await (const line of file.readLines()) { console.log(line); } } finally { - await fh?.close(); + await file?.close(); } ``` @@ -515,15 +515,15 @@ try { const { open } = require('node:fs/promises'); (async () => { - let fh; + let file; try { - fh = await open(__filename); + file = await open('./some/file/to/read'); - for await (const line of fh.readLines()) { + for await (const line of file.readLines()) { console.log(line); } } finally { - await fh?.close(); + await file?.close(); } })(); ```