title: how do I use curl.js to load an object?
body: <p><a href="https://github.com/cujojs/curl" rel="nofollow noreferrer">Curl 0.7.3</a></p>
  
  <p>I got some AMD/CommonJS adapter code from here:
  <a href="https://stackoverflow.com/questions/13673346/supporting-both-commonjs-and-amd">supporting both CommonJS and AMD</a>    </p>
  
  <pre><code>(function (name, definition) {
        if (typeof module != 'undefined') {
          module.exports = definition();
        }
        else if (typeof define == 'function' &amp;&amp; typeof define.amd == 'object') {
          define(name, [], definition);
        }
        else {
          this[name] = definition();
        }
      }('modXyz', {
            sayHi:function (name) {
              console.log('Hi ' + name + '!');
            }
          }
      ));
  </code></pre>
  
  <p>I'd like to use that code with <a href="https://github.com/cujojs/curl" rel="nofollow noreferrer">Curl</a> to make all my code AMD/CommonJS compatible. What I was expecting to be able to do was this: </p>
  
  <pre><code>greeter = curl(['modXyz']); 
  greeter.sayHi("Gracie"); 
  </code></pre>
  
  <p>But the object that <code>curl</code> returns isn't the object I'm expecting. The closest I can get is this: </p>
  
  <pre><code>curl(['modXyz'], function(mod) { window.greeter = mod; }); 
  greeter.sayHi("Gracie");
  </code></pre>
  
  <p>Which seems to defeat the purpose of AMD. Is curl capable of doing something like this? Do I have to use <a href="http://requirejs.org/docs/whyamd.html" rel="nofollow noreferrer">require.js</a> to get it to happen? </p>