madrobby/keymaster — pull request #74 by HenrikJoreteg (2013-01-10 15:08:15+00:00)
Title: Use noConflict by default for CommonJS

Hey, Thomas!

When requiring a module with CommonJS style I generally assume it's not going to create any globals for me. Since I'll be assigning the required module to your own variable when requiring it anyway:

```js
var key = require('keymaster');
```

I simply tweaked it to call `noConflict` if you're requiring it.

```js
if(typeof module !== 'undefined') {
module.exports = key;
noConflict();
}
```

It's a silly little thing, but figured I'd propose this change if you want it. That's the pattern I've seen in other projects that do both, like backbone, etc: https://github.com/documentcloud/backbone/blob/master/backbone.js#L30