diff options
author | Jenna Vuong <hello@jennavuong.com> | 2016-05-01 00:58:16 -0700 |
---|---|---|
committer | Robert Jefe Lindstaedt <robert.lindstaedt@gmail.com> | 2016-05-03 20:35:50 +0200 |
commit | 2aa376914b621018c5784104b82c13e78ee51307 (patch) | |
tree | d35082509b0cf09e25396ad2867c859b0d5f6068 /doc | |
parent | 51e7bc8f79eb99d402d5633dcfd8b147318c4b40 (diff) | |
download | node-new-2aa376914b621018c5784104b82c13e78ee51307.tar.gz |
doc: adds 'close' events to fs.ReadStream and fs.WriteStream
Add 'close' event to doc/api/fs.md --> fs.ReadStream
Add 'close' event to doc/api/fs.md --> fs.WriteStream
Add 'close event to doc/api/stream.md --> stream.Writable
From squashed history:
Add 'close' event to stream.Writable per Issue #6484
Add #### prefix to Event: 'close' and backticks to 'close'
similar to stream.Readable event: 'close' section
Add more specifics to 'close' events for fs.ReadStream
and fs.WriteStream
Fix/Changed 'close' event from 'fs.ReadStream' to 'fs.WriteStream'
wrapped long lines at 80 chars, reworded
per Issue #6484
including the 'close' event as optional
add 'close' event as optional in stream.Readable
per issue #6484
doc: Add 'close' events to fs.ReadStream, 80char nit
Fixes: #6484
PR-URL: https://github.com/nodejs/node/pull/6499
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Robert Jefe Lindstaedt <robert.lindstaedt@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/fs.md | 10 | ||||
-rw-r--r-- | doc/api/stream.md | 12 |
2 files changed, 21 insertions, 1 deletions
diff --git a/doc/api/fs.md b/doc/api/fs.md index f480c29eb1..895d5c5e93 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -151,6 +151,11 @@ Stop watching for changes on the given `fs.FSWatcher`. Emitted when the ReadStream's file is opened. +### Event: 'close' + +Emitted when the `ReadStream`'s underlying file descriptor has been closed +using the `fs.close()` method. + ### readStream.path The path to the file the stream is reading from as specified in the first @@ -238,6 +243,11 @@ on Unix systems, it never was. Emitted when the WriteStream's file is opened. +### Event: 'close' + +Emitted when the `WriteStream`'s underlying file descriptor has been closed +using the `fs.close()` method. + ### writeStream.bytesWritten The number of bytes written so far. Does not include data that is still queued diff --git a/doc/api/stream.md b/doc/api/stream.md index a7478bf3de..9a981288f1 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -160,7 +160,8 @@ Emitted when the stream and any of its underlying resources (a file descriptor, for example) have been closed. The event indicates that no more events will be emitted, and no further computation will occur. -Not all streams will emit the `'close'` event. +Not all streams will emit the `'close'` event as the `'close'` event is +optional. #### Event: 'data' @@ -573,6 +574,15 @@ Examples of writable streams include: * [child process stdin][] * [`process.stdout`][], [`process.stderr`][] +#### Event: 'close' + +Emitted when the stream and any of its underlying resources (a file descriptor, +for example) have been closed. The event indicates that no more events will be +emitted, and no further computation will occur. + +Not all streams will emit the `'close'` event as the `'close'` event is +optional. + #### Event: 'drain' If a [`stream.write(chunk)`][stream-write] call returns `false`, then the |