diff options
author | Henadzi <74081058+Gena888@users.noreply.github.com> | 2021-11-02 21:52:43 +0300 |
---|---|---|
committer | Matteo Collina <hello@matteocollina.com> | 2021-12-04 19:29:21 +0300 |
commit | 069d2bd2507b62d819b590df859e0db79fb7996f (patch) | |
tree | a1ba0f5ca96885d75ee12ea4d3df16b362c94f8e /doc/api/stream.md | |
parent | c802c4b173543f8f8ac56b9bbc740579e898bc08 (diff) |
doc: add explicit declaration of fd with null val
In example of implementing a writable stream with extending on
Writable add explicit declaration of 'fd' (file descriptor)
variable with null value.
It will make this example more similar to readable stream's one.
And will make it easier to figure out in topic.
PR-URL: https://github.com/nodejs/node/pull/40704
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'doc/api/stream.md')
-rw-r--r-- | doc/api/stream.md | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/doc/api/stream.md b/doc/api/stream.md index 4f242a5d519..8ca8fb1db5c 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -2612,6 +2612,7 @@ class WriteStream extends Writable { constructor(filename) { super(); this.filename = filename; + this.fd = null; } _construct(callback) { fs.open(this.filename, (err, fd) => { |