Skip to content

Commit be2a467

Browse files
not-an-aardvarktargos
authored andcommitted
doc: fix incorrect fs.readFileSync example output
This fixes an incorrect example in the documentation for calling `fs.readFileSync` on a directory. The example was presumably copied from the documentation for `fs.readFile`, which has an error argument in its callback. PR-URL: #20902 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent 4963bcc commit be2a467

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doc/api/fs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2367,7 +2367,7 @@ fs.readFileSync('<directory>');
23672367
// => [Error: EISDIR: illegal operation on a directory, read <directory>]
23682368

23692369
// FreeBSD
2370-
fs.readFileSync('<directory>'); // => null, <data>
2370+
fs.readFileSync('<directory>'); // => <data>
23712371
```
23722372

23732373
## fs.readlink(path[, options], callback)

0 commit comments

Comments
 (0)