kripken / box2d.js

Port of Box2D to JavaScript using Emscripten
1.33k stars 196 forks source link

Errors in Node.js environment #12

Open schulzch opened 11 years ago

schulzch commented 11 years ago

There are some issues with using box2d.js in a Node.js environment:

The fixes are easy, but I have no idea where to put them:

Cheers, Chris

schulzch commented 11 years ago

I fiddled around a bit and came up with the following solution:

/*
 * https://github.com/kripken/box2d.js
 *
 * box2d.js is zlib licensed, just like Box2D.
 */
// ... COMPILED ONE LINER GOES HERE ...
module.exports = this.Box2D;

Edit: Adding --globals Module to mocha's command line seems cleaner for now.