josephg/Chipmunk-js — Issue #1: Don't set window.cp global if exports exists
Author: ryanwilliams
Created: 2012-01-16 05:24:20+00:00
State: open

Hi,

In my opinion CP shouldn't set the window.cp global if module.exports exists. i.e. If someone is using commonJS module system, they probably don't want the global being there and will instead 'require' in the lib as needed.

So the top should look something like:

```javascript
var cp;
if(typeof exports === 'undefined'){
cp = {};
if(typeof window === 'object'){
window.cp = cp;
}
} else {
cp = exports;
}
```