diff --git a/doc/api/fs.md b/doc/api/fs.md index 0daf2e5f5d0879..c3c3fd669dc59a 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -126,6 +126,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. @@ -210,6 +215,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 37ea2a4b1fce83..c2cf1d4f5a79e4 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