Skip to content

Commit 04c4c1f

Browse files
davisjamMylesBorins
authored andcommitted
doc: fs.readFile is async but not partitioned
This change was suggested during the discussion of #17054. PR-URL: #17154 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]>
1 parent b6929e2 commit 04c4c1f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

doc/api/fs.md

+5
Original file line numberDiff line numberDiff line change
@@ -1897,6 +1897,11 @@ Any specified file descriptor has to support reading.
18971897
*Note*: If a file descriptor is specified as the `path`, it will not be closed
18981898
automatically.
18991899

1900+
*Note*: `fs.readFile()` reads the entire file in a single threadpool request.
1901+
To minimize threadpool task length variation, prefer the partitioned APIs
1902+
`fs.read()` and `fs.createReadStream()` when reading files as part of
1903+
fulfilling a client request.
1904+
19001905
## fs.readFileSync(path[, options])
19011906
<!-- YAML
19021907
added: v0.1.8

0 commit comments

Comments
 (0)