VOOZH about

URL: https://www.geeksforgeeks.org/node-js/node-js-readable-stream-close-event/

⇱ Node.js Readable Stream close Event - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Node.js Readable Stream close Event

Last Updated : 12 Oct, 2021
The 'close' Event in a Readable Stream is emitted when the stream and any of its hidden resources are being closed This event implies that no further events can be emitted, and no further computations can take place. Moreover, if a Readable stream is created with the emitClose option then it can always emit 'close' event. Syntax:
Event: 'close '
Below examples illustrate the use of close event in Node.js: Example 1: Output:
Done...
Stream ended
Example 2: Output:
Done...
Here, close method is not called so close event is not emitted. Reference: https://nodejs.org/api/stream.html#stream_event_close_1.
Comment

Explore