code: function LineStream(writeStream, readStream) {
      var self = this;
      this.writeStream = writeStream;
      this.readStream = readStream;
  
      // resume streams
      this.readStream.resume();
  
      // save data in this buffer
      this.buffer = "";
  
      // new data from stream will be handled by this
      this.readStream.on('data', function (chunk) {
        self.buffer += chunk;
  
        // go through the buffer and isolate each message by a linebreak
        var i, start = 0;
        while ((i = self.buffer.indexOf('\n', start)) >= 0) {
  
          // parse line as JSON and emit line
          self.emit('message', JSON.parse(self.buffer.slice(start, i)));
          start = i + 1;
        }
        self.buffer = self.buffer.slice(start);
      });
    }
docs: This constructor will create a I/O line stream
  from a writable and readable stream