Skip to content

Commit 6ec9a70

Browse files
kovanclaude
authored andcommitted
doc: clarify fs.ReadStream and fs.WriteStream are not constructable
Add explicit wording that fs.ReadStream and fs.WriteStream should not be constructed directly, matching the existing pattern used by fs.Stats ("not to be created directly using the new keyword"). The factory functions fs.createReadStream() and fs.createWriteStream() are the supported API. Fixes: #40546 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> PR-URL: #62208 Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent 1fc86fc commit 6ec9a70

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

doc/api/fs.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7067,8 +7067,8 @@ added: v0.1.93
70677067
70687068
* Extends: {stream.Readable}
70697069
7070-
Instances of {fs.ReadStream} are created and returned using the
7071-
[`fs.createReadStream()`][] function.
7070+
Instances of {fs.ReadStream} cannot be constructed directly. They are created and
7071+
returned using the [`fs.createReadStream()`][] function.
70727072
70737073
#### Event: `'close'`
70747074
@@ -7656,8 +7656,8 @@ added: v0.1.93
76567656
76577657
* Extends {stream.Writable}
76587658
7659-
Instances of {fs.WriteStream} are created and returned using the
7660-
[`fs.createWriteStream()`][] function.
7659+
Instances of {fs.WriteStream} cannot be constructed directly. They are created and
7660+
returned using the [`fs.createWriteStream()`][] function.
76617661
76627662
#### Event: `'close'`
76637663

0 commit comments

Comments
 (0)