Skip to content

Commit 10646ba

Browse files
kovanclaude
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>
1 parent 3bbed16 commit 10646ba

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
@@ -7147,8 +7147,8 @@ added: v0.1.93
71477147
71487148
* Extends: {stream.Readable}
71497149
7150-
Instances of {fs.ReadStream} are created and returned using the
7151-
[`fs.createReadStream()`][] function.
7150+
`fs.ReadStream` is not to be constructed directly; use
7151+
[`fs.createReadStream()`][] instead.
71527152
71537153
#### Event: `'close'`
71547154
@@ -7918,8 +7918,8 @@ added: v0.1.93
79187918
79197919
* Extends {stream.Writable}
79207920
7921-
Instances of {fs.WriteStream} are created and returned using the
7922-
[`fs.createWriteStream()`][] function.
7921+
`fs.WriteStream` is not to be constructed directly; use
7922+
[`fs.createWriteStream()`][] instead.
79237923
79247924
#### Event: `'close'`
79257925

0 commit comments

Comments
 (0)