Skip to content

Commit 4a1f20e

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 40a43ac commit 4a1f20e

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
@@ -7155,8 +7155,8 @@ added: v0.1.93
71557155
71567156
* Extends: {stream.Readable}
71577157
7158-
Instances of {fs.ReadStream} are created and returned using the
7159-
[`fs.createReadStream()`][] function.
7158+
Instances of {fs.ReadStream} cannot be constructed directly. They are created and
7159+
returned using the [`fs.createReadStream()`][] function.
71607160
71617161
#### Event: `'close'`
71627162
@@ -7926,8 +7926,8 @@ added: v0.1.93
79267926
79277927
* Extends {stream.Writable}
79287928
7929-
Instances of {fs.WriteStream} are created and returned using the
7930-
[`fs.createWriteStream()`][] function.
7929+
Instances of {fs.WriteStream} cannot be constructed directly. They are created and
7930+
returned using the [`fs.createWriteStream()`][] function.
79317931
79327932
#### Event: `'close'`
79337933

0 commit comments

Comments
 (0)