Skip to content

Instantly share code, notes, and snippets.

@mildfuzz
Created February 10, 2016 13:29
Show Gist options
  • Select an option

  • Save mildfuzz/2d1d306dbf4b475c99ca to your computer and use it in GitHub Desktop.

Select an option

Save mildfuzz/2d1d306dbf4b475c99ca to your computer and use it in GitHub Desktop.
Cross Module Loading Platform Module Definition
(function(){
"use strict";
var module = function(){
//my module code};
};
if(typeof define !== 'undefined' && typeof define.amd !== 'undefined' ){
define(function(){
return module;
});
} else if(typeof module !== 'undefined' && typeof module.exports !== 'undefined' ){
module.exports = module;
} else {
return module;
}
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment