joyent/node — pull request #5464 by Raynos (2013-05-13 19:04:27+00:00)
Title: have events module exports EventEmitter, substack style.

This change is 100% backwards compatible.

This change will make using `EventEmitter` slightly simpler / nicer and adheres to the best practice set forth by substack.

```js
var EventEmitter = require("events")

var emitter = new EventEmitter()
```

I know the API is frozen however this isn't an API change as much as it is just a "what do we export change".

The only difference is that we now have to set `EventEmitter` as a property of `EventEmitter` for backwards compatibility like we do with [`Stream`][1]

We have also set the `usingDomains` property on the `EventEmitter` constructor itself because that aligns with it's current usage of `require("events").usingDomains = true`

There are other internals that would benefit from this change as well like `StringDecoder`

**advantages:**

- makes code using EventEmitter slightly simpler
- adheres to common practice of export one thing

**disadvantages:**

- The API is frozen, we can't do this.
- Allows for 0.12 only code using EventEmitter that will break in 0.10