Permalink
Browse files

allow inheritency things

  • Loading branch information...
1 parent 331317c commit 8c2546e50b3f5db17fcfe08882cb1d752b81b4f7 @substack committed Sep 23, 2012
Showing with 4 additions and 5 deletions.
  1. +3 −4 index.js
  2. +1 −1 package.json
View
@@ -18,7 +18,10 @@ var reqProps = [
];
var reqEvents = [ 'data', 'end', 'error', 'close' ];
+module.exports = HttpDuplex;
+
function HttpDuplex (req, res) {
+ if (this === global) return new HttpDuplex(req, res);
DuplexStream.call(this);
var self = this;
@@ -70,7 +73,3 @@ HttpDuplex.prototype.destroy = function () {
this.request.destroy();
this.response.destroy();
};
-
-module.exports = function (req, res) {
- return new HttpDuplex(req, res);
-};
View
@@ -1,6 +1,6 @@
{
"name" : "http-duplex",
- "version" : "0.0.1",
+ "version" : "0.0.2",
"description" : "turn (req,res) pairs into a single duplex stream",
"main" : "index.js",
"directories" : {

0 comments on commit 8c2546e

Please sign in to comment.