Skip to content

Commit ba0a82a

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 78ac17f commit ba0a82a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

doc/api/fs.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7138,8 +7138,8 @@ added: v0.1.93
71387138
71397139
* Extends: {stream.Readable}
71407140
7141-
Instances of {fs.ReadStream} are created and returned using the
7142-
[`fs.createReadStream()`][] function.
7141+
Instances of {fs.ReadStream} cannot be constructed directly. They are created and
7142+
returned using the [`fs.createReadStream()`][] function.
71437143
71447144
#### Event: `'close'`
71457145
@@ -7909,8 +7909,8 @@ added: v0.1.93
79097909
79107910
* Extends {stream.Writable}
79117911
7912-
Instances of {fs.WriteStream} are created and returned using the
7913-
[`fs.createWriteStream()`][] function.
7912+
Instances of {fs.WriteStream} cannot be constructed directly. They are created and
7913+
returned using the [`fs.createWriteStream()`][] function.
79147914
79157915
#### Event: `'close'`
79167916

0 commit comments

Comments
 (0)