Permalink
Browse files

export CBuffer properly if node application

  • Loading branch information...
1 parent 7473602 commit ffe0fd6cab85c3479d5a4068c23c1c590d9cd687 @trevnorris committed Apr 17, 2012
Showing with 3 additions and 2 deletions.
  1. +2 −1 cbuffer.js
  2. +1 −1 test/env.js
View
3 cbuffer.js
@@ -239,6 +239,7 @@ CBuffer.prototype = {
}
};
-global.CBuffer = CBuffer;
+if ( module && module.exports ) module.exports = CBuffer;
+else global.CBuffer = CBuffer;
}( this ));
View
2 test/env.js
@@ -1 +1 @@
-CBuffer = require( '../cbuffer.js' ).CBuffer;
+CBuffer = require( '../cbuffer.js' );

0 comments on commit ffe0fd6

Please sign in to comment.