Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request - node.js/commonJS support #22

Open
GoogleCodeExporter opened this issue Aug 24, 2015 · 1 comment
Open

Feature request - node.js/commonJS support #22

GoogleCodeExporter opened this issue Aug 24, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

The feature request is a node.js (and incidentally a commonJS compatible) 
version of the library.

Following the node.js and CommonJS specification http://www.commonjs.org/specs/ 
I added a lot of 'exports'-assignments at the end of the library like so:

exports.Box2D = {} ;
exports.Box2D.Collision = {};
exports.Box2D.Collision.b2AABB = Box2D.Collision.b2AABB;
exports.Box2D.Collision.b2Bound = Box2D.Collision.b2Bound;
...

and so on for all public API functions. 

I have only done minimal testing but so far it works as expected with setting 
up the world and simulating some simple things. 

Even cooler would be if the library was available through the node package 
manager (http://npmjs.org/).

Original issue reported on code.google.com by jo...@zoom.nu on 15 Aug 2011 at 4:53

@GoogleCodeExporter
Copy link
Author

I've build a patch against r29, that adds exports and fixes a bug in 
Object.defineProperty() fallback (Object.prototype.defineProperty is undefined 
in Node.js, thus Object.defineProperty gets overwritten, which occasionaly 
corrupts this...).

Original comment by schulz...@gmail.com on 23 Nov 2012 at 5:11

Attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant