Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

export CBuffer properly if node application

  • Loading branch information...
commit ffe0fd6cab85c3479d5a4068c23c1c590d9cd687 1 parent 7473602
Trevor Norris authored
Showing with 3 additions and 2 deletions.
  1. +2 −1  cbuffer.js
  2. +1 −1  test/env.js
3  cbuffer.js
View
@@ -239,6 +239,7 @@ CBuffer.prototype = {
}
};
-global.CBuffer = CBuffer;
+if ( module && module.exports ) module.exports = CBuffer;
+else global.CBuffer = CBuffer;
}( this ));
2  test/env.js
View
@@ -1 +1 @@
-CBuffer = require( '../cbuffer.js' ).CBuffer;
+CBuffer = require( '../cbuffer.js' );
Please sign in to comment.
Something went wrong with that request. Please try again.