CatTail
6/13/2013 - 4:33 PM

Cross plantform module export

Cross plantform module export

(function() {
  var root = this;
  // AMD / RequireJS
  if (typeof define !== 'undefined' && define.amd) {
    define('modulename', [], function () {
      return global;
    });
  }
  // Node.js
  else if (typeof module !== 'undefined' && module.exports) {
    module.exports = global;
  }
  // included directly via <script> tag
  else {
    root.modulename = global;
  }
})()