Skip to content

Commit 5823938

Browse files
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 7f610a1 commit 5823938

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
@@ -2377,7 +2377,7 @@ fs.readFileSync('<directory>');
23772377
// => [Error: EISDIR: illegal operation on a directory, read <directory>]
23782378

23792379
// FreeBSD
2380-
fs.readFileSync('<directory>'); // => null, <data>
2380+
fs.readFileSync('<directory>'); // => <data>
23812381
```
23822382

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

0 commit comments

Comments
 (0)