mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
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: https://github.com/nodejs/node/issues/40546
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PR-URL: https://github.com/nodejs/node/pull/62208
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
1 parent
78ac17f426
commit
ba0a82a1e1
1 file changed
+4
-4
+4
-4
@@ -7138,8 +7138,8 @@ added: v0.1.93
|
||||
|
||||
* Extends: {stream.Readable}
|
||||
|
||||
Instances of {fs.ReadStream} are created and returned using the
|
||||
[`fs.createReadStream()`][] function.
|
||||
Instances of {fs.ReadStream} cannot be constructed directly. They are created and
|
||||
returned using the [`fs.createReadStream()`][] function.
|
||||
|
||||
#### Event: `'close'`
|
||||
|
||||
@@ -7909,8 +7909,8 @@ added: v0.1.93
|
||||
|
||||
* Extends {stream.Writable}
|
||||
|
||||
Instances of {fs.WriteStream} are created and returned using the
|
||||
[`fs.createWriteStream()`][] function.
|
||||
Instances of {fs.WriteStream} cannot be constructed directly. They are created and
|
||||
returned using the [`fs.createWriteStream()`][] function.
|
||||
|
||||
#### Event: `'close'`
|
||||
|
||||
|
||||
Reference in new issue
Block a user