O'Reilly logo
  • Patrick S thinks this is interesting:

A Duplex stream is a stream that combines Readable and Writable functionality. A good example of a duplex stream is a TCP socket connection. You can read and write from the socket connection once it has been created.

To implement your own custom Duplex stream object you will need to first inherit the functionality for Duplex streams. The simplest way to do that is to use the following code that uses the util module’s inherits() method:


Cover of Node.js, MongoDB, and AngularJS Web Development


Duplex streams