Skip to content

Commit ad841a2

Browse files
WesTylerMylesBorins
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 338014e commit ad841a2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

doc/api/fs.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,9 @@ default value of 64 kb for the same parameter.
503503

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

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

0 commit comments

Comments
 (0)