Skip to content

Commit

Permalink
doc: fs.readFile is async but not partitioned
Browse files Browse the repository at this point in the history
This change was suggested during the discussion of #17054.

PR-URL: #17154
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
  • Loading branch information
davisjam authored and MylesBorins committed Dec 12, 2017
1 parent b6929e2 commit 04c4c1f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -1897,6 +1897,11 @@ Any specified file descriptor has to support reading.
*Note*: If a file descriptor is specified as the `path`, it will not be closed
automatically.

*Note*: `fs.readFile()` reads the entire file in a single threadpool request.
To minimize threadpool task length variation, prefer the partitioned APIs
`fs.read()` and `fs.createReadStream()` when reading files as part of
fulfilling a client request.

## fs.readFileSync(path[, options])
<!-- YAML
added: v0.1.8
Expand Down

0 comments on commit 04c4c1f

Please sign in to comment.