Skip to content

Commit

Permalink
doc: remove unclear text from fs.write()
Browse files Browse the repository at this point in the history
There is a paragraph explaining that `fs.write()` cannot write a
substring of the provided string. It's not clear what `buffer` refers
to in that paragraph or even what the purpose of the paragraph is.
There's no suggestion elsewhere that `fs.write()` should be expected to
have a substring feature. Remove the paragraph.

PR-URL: #20450
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
Trott authored and MylesBorins committed May 4, 2018
1 parent 459c20c commit 5a839b9
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -3233,10 +3233,6 @@ The callback will receive the arguments `(err, written, string)` where `written`
specifies how many _bytes_ the passed string required to be written. Note that
bytes written is not the same as string characters. See [`Buffer.byteLength`][].

Unlike when writing `buffer`, the entire string must be written. No substring
may be specified. This is because the byte offset of the resulting data may not
be the same as the string offset.

Note that it is unsafe to use `fs.write` multiple times on the same file
without waiting for the callback. For this scenario,
`fs.createWriteStream` is strongly recommended.
Expand Down

0 comments on commit 5a839b9

Please sign in to comment.