title: Converting CommonJS to AMD
body: <p>I have a simple CommonJS module published on NPM and Bower that basically just looks like this:</p>
  
  <pre><code>  function Foo(){}
  
      module.exports = new Foo();
  </code></pre>
  
  <p>now the easiest way to convert to AMD format would be just to publish a second version that was AMD compatible like so:</p>
  
  <pre><code>define(function (require, exports, module) {
  
      function Foo(){}
  
      module.exports = new Foo();
  
  });
  </code></pre>
  
  <p>but I thought there was a way you can shim the CommonJS module using requirejs.config like so:</p>
  
  <pre><code>requirejs.config({
  
     paths:{
      'foo':'assets/vendor/foo'
     },
     shim:{
  
       'foo' :{
         exports: 'Foo'
        }
     }
  });
  </code></pre>
  
  <p>but this doesn't seem to work. I figure that the shim tool does the wrapping that I did above for you, but I am not entirely sure.</p>