VOOZH about

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

⇱ Node.js Readable Stream data Event - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Node.js Readable Stream data Event

Last Updated : 12 Oct, 2021
The 'data' Event in a Readable Stream is emitted when readable.pipe() and readable.resume() method is called for switching the stream into the flowing mode or by adding a listener callback to the data event. This event can also be emitted by calling readable.read() method and returning the chunk of data available. Syntax:
Event: 'data'
Below examples illustrate the use of data event in Node.js: Example 1: Output:
Done...
chunk length is: 13
read: GeeksforGeeks
Example 2: Output:
Done...
Reference: https://nodejs.org/api/stream.html#stream_event_data.
Comment

Explore