First of all, .use()
is called asynchronously. When calling AUI().use('node', function(A) {...});
, the node-module has to be loaded and attached before the the function inside (function(A) {...}
) is called.
So what is happening is that while the node-module is being loaded, the code lines after use()
are being called, and when the module has been successfully loaded and attached, the function (function(A) {...}
) is called.
See the documentation on .use()
here: http://yuilibrary.com/yui/docs/yui/#understanding-yuiuse
(AUI is an extension of YUI)
This might also be helpful: Getting started with YUI3 and AlloyUI