Directly export the Stream constructor.

Also setting up a circular reference back to the
stream as `Stream.Stream`, for backwards-compatibility.

Fixes #1933
pull/22966/head
Nathan Rajlich 2011-10-24 14:52:10 -07:00 committed by Ryan Dahl
parent 239b3d62de
commit 58cb0fa639
1 changed files with 3 additions and 1 deletions

View File

@ -26,7 +26,9 @@ function Stream() {
events.EventEmitter.call(this);
}
util.inherits(Stream, events.EventEmitter);
exports.Stream = Stream;
module.exports = Stream;
// Backwards-compat with node 0.4.x
Stream.Stream = Stream;
Stream.prototype.pipe = function(dest, options) {
var source = this;