lib/event_buffer.js
function (src, events) {
  // By default, we service the default stream events
  var self = this
    , streamEvents = ['data', 'end', 'error', 'close', 'fd', 'drain', 'pipe'];
  this.events = events || streamEvents;
  this.emitter = src;
  this.eventBuffer = [];
  this.outlet = null;
  this.events.forEach(function (name) {
    self.emitter.addListener(name, function () {
      self.proxyEmit(name, arguments);
    });
  });
}
function (src, events) {
  // By default, we service the default stream events
  var self = this
    , streamEvents = ['data', 'end', 'error', 'close', 'fd', 'drain', 'pipe'];
  this.events = events || streamEvents;
  this.emitter = src;
  this.eventBuffer = [];
  this.outlet = null;
  this.events.forEach(function (name) {
    self.emitter.addListener(name, function () {
      self.proxyEmit(name, arguments);
    });
  });
}
function ( src , events ) { // By default, we service the default stream events var self = this , streamEvents = [ 'data' , 'end' , 'error' , 'close' , 'fd' , 'drain' , 'pipe' ] ; this . events = events || streamEvents ; this . emitter = src ; this . eventBuffer = [ ] ; this . outlet = null ; this . events . forEach ( function ( name ) { self . emitter . addListener ( name , function ( ) { self . proxyEmit ( name , arguments ) ; } ) ; } ) ; }
/*
This is a very simple buffer for a predetermined set of events. It is unbounded.
It forwards all arguments to any outlet emitter attached with sync().

Example:
var source = new Stream()
, dest = new EventEmitter()
, buff = new EventBuffer(source)
, data = '';
dest.on('data', function (d) { data += d; });
source.writeable = true;
source.readable = true;
source.emit('data', 'abcdef');
source.emit('data', '123456');
buff.sync(dest);
 
@name EventBuffer
@namespace EventBuffer
@constructor
/ * This is a very simple buffer for a predetermined set of events . It is unbounded . It forwards all arguments to any outlet emitter attached with sync () .