events: have events module exports EventEmitter
authorRaynos <raynos2@gmail.com>
Mon, 13 May 2013 19:04:06 +0000 (13:04 -0600)
committerisaacs <i@izs.me>
Tue, 20 Aug 2013 00:27:08 +0000 (17:27 -0700)
commit6ed861dd7feea33224d1cac8e64010b45974ae51
treeb1cd7bbb99a5357147a1940c1ff56ece10019a95
parentc171c490f2d850f63a37496bc7b31855193ce298
events: have events module exports EventEmitter

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()
```

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`
lib/events.js