

Using EventEmitters in Node.js + CoffeeScript to decouple modules - TrevorBurnham
http://pragprog.com/magazines/2011-08/decouple-your-apps-with-eventdriven-coffeescript

======
TrevorBurnham
"I'm the author, ask me anything," as they say.

One of the interesting and/or frustrating things about Node.js is that,
although it's based on a very dynamic language where you can modify (nearly)
any object at any time, it also encourages strict modularization where, if "x"
requires "foo," "bar," and "baz," then it's got to explicitly `require` all of
those scripts.

Bringing dependencies in with `require` makes testing a pain. I don't think
anyone's quite cut the Gordion knot of how testing should be done in Node;
it's an open problem, and I certainly don't think I have the full solution. My
intent with this article is to get people to realize just how much flexibility
they have in organizing their Node apps. The "best practices" haven't emerged
yet, and that's kind of cool.

