diff --git a/docs/guides/read-file/watch.mdx b/docs/guides/read-file/watch.mdx index ab27043c88..dde7a8c2a1 100644 --- a/docs/guides/read-file/watch.mdx +++ b/docs/guides/read-file/watch.mdx @@ -23,8 +23,8 @@ To listen to changes in subdirectories, pass the `recursive: true` option to `fs ```ts import { watch } from "fs"; -const watcher = watch(import.meta.dir, { recursive: true }, (event, filename) => { - console.log(`Detected ${event} in ${filename}`); +const watcher = watch(import.meta.dir, { recursive: true }, (event, relativePath) => { + console.log(`Detected ${event} in ${relativePath}`); }); ```