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: https://github.com/nodejs/node/pull/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>
This commit is contained in:
Teddy Katz 2018-05-22 19:54:30 -04:00
parent 7f610a1eec
commit 5823938d15
No known key found for this signature in database
GPG Key ID: B79EC7ABC0AA53A0

View File

@ -2377,7 +2377,7 @@ fs.readFileSync('<directory>');
// => [Error: EISDIR: illegal operation on a directory, read <directory>]
// FreeBSD
fs.readFileSync('<directory>'); // => null, <data>
fs.readFileSync('<directory>'); // => <data>
```
## fs.readlink(path[, options], callback)