aws/aws-sdk-js — pull request #181 by unscriptable (2013-10-31 21:22:12+00:00)
Title: A very simple example of how to use modules

This code is no longer using the CommonJS equivalent of a global namespace (`var AWS = require("../core");`).

This anti-pattern is causing unnecessary circular dependencies (throughout the project), but -- more importantly -- allows developers to use deep objects on its hierarchy. This is the root of "dependency hell" caused by globals. You've just recreated it in CommonJS.

I also removed an implicit dependency on one such deep object: `AWS.Service.defineService`. There's no `require` specifying this dependency. It's just magically available somehow. This is an example of "dependency hell" in action. There's no way a human or machine could easily know what the requirements of this module were before I made it explicit.

I'm not 100% sure, but I don't think the previous code will transpile to ES6 format. The code I wrote will.