Skip to content

Commit 78e188d

Browse files
WesTyleraddaleax
authored andcommitted
doc: clarify fs.createReadStream options
* start/end start *counting* at 0 * If fd is specified and start is omitted or undefined, fs.createReadStream() reads sequentially from the current file position. Fixes: #7099 PR-URL: #10078 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
1 parent 44d9bc8 commit 78e188d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

doc/api/fs.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,9 @@ default value of 64 kb for the same parameter.
602602

603603
`options` can include `start` and `end` values to read a range of bytes from
604604
the file instead of the entire file. Both `start` and `end` are inclusive and
605-
start at 0. The `encoding` can be any one of those accepted by [`Buffer`][].
605+
start counting at 0. If `fd` is specified and `start` is omitted or `undefined`,
606+
`fs.createReadStream()` reads sequentially from the current file position.
607+
The `encoding` can be any one of those accepted by [`Buffer`][].
606608

607609
If `fd` is specified, `ReadStream` will ignore the `path` argument and will use
608610
the specified file descriptor. This means that no `'open'` event will be

0 commit comments

Comments
 (0)