VOOZH about

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

⇱ Node.js Readable Stream pause Event - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Node.js Readable Stream pause Event

Last Updated : 12 Oct, 2021
The 'pause' Event in a Readable Stream is emitted when stream.pause() is being called and readableFlowing property is not false. Syntax:
Event: 'pause'
Return Value: It is emitted if readable.pause() is being called else it is not emitted. Below examples illustrate the use of pause event in Node.js: Example 1: Output:
pause emitted!
Program ends....
Example 2: Output:
Program ends....
GeeksforGeeks
Here, pause() method is not called so pause event is not emitted. Reference: https://nodejs.org/api/stream.html#stream_event_pause
Comment

Explore