Sha256: 3de77f38a2ab5db028c016059d74c1735c93410a9cbd34f6c889b5b639c5933d

Contents?: true

Size: 595 Bytes

Versions: 17

Compression:

Stored size: 595 Bytes

Contents

module.exports = function(obj){
  var onData
    , onEnd
    , events = [];

  // buffer data
  obj.on('data', onData = function(data, encoding){
    events.push(['data', data, encoding]);
  });

  // buffer end
  obj.on('end', onEnd = function(data, encoding){
    events.push(['end', data, encoding]);
  });

  return {
    end: function(){
      obj.removeListener('data', onData);
      obj.removeListener('end', onEnd);
    },
    resume: function(){
      this.end();
      for (var i = 0, len = events.length; i < len; ++i) {
        obj.emit.apply(obj, events[i]);
      }
    }
  };
};

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
hooch-0.4.2 jasmine/node_modules/karma/node_modules/connect/node_modules/pause/index.js
hooch-0.4.1 jasmine/node_modules/karma/node_modules/connect/node_modules/pause/index.js
hooch-0.4.0 jasmine/node_modules/karma/node_modules/connect/node_modules/pause/index.js
hooch-0.3.0 jasmine/node_modules/karma/node_modules/connect/node_modules/pause/index.js
hooch-0.2.1 jasmine/node_modules/karma/node_modules/connect/node_modules/pause/index.js
hooch-0.2.0 jasmine/node_modules/karma/node_modules/connect/node_modules/pause/index.js
hooch-0.1.0 jasmine/node_modules/karma/node_modules/connect/node_modules/pause/index.js
hooch-0.0.8 jasmine/node_modules/karma/node_modules/connect/node_modules/pause/index.js
hooch-0.0.7 jasmine/node_modules/karma/node_modules/connect/node_modules/pause/index.js
hooch-0.0.6 jasmine/node_modules/karma/node_modules/connect/node_modules/pause/index.js
entangled-0.0.16 spec/dummy/public/node_modules/karma/node_modules/connect/node_modules/pause/index.js
entangled-0.0.15 spec/dummy/public/node_modules/karma/node_modules/connect/node_modules/pause/index.js
entangled-0.0.14 spec/dummy/public/node_modules/karma/node_modules/connect/node_modules/pause/index.js
entangled-0.0.13 spec/dummy/public/node_modules/karma/node_modules/connect/node_modules/pause/index.js
entangled-0.0.12 spec/dummy/public/node_modules/karma/node_modules/connect/node_modules/pause/index.js
entangled-0.0.11 spec/dummy/public/node_modules/karma/node_modules/connect/node_modules/pause/index.js
entangled-0.0.10 spec/dummy/public/node_modules/karma/node_modules/connect/node_modules/pause/index.js