Last active
August 29, 2015 13:55
-
-
Save joelgriffith/8744874 to your computer and use it in GitHub Desktop.
The End-all JavaScript Module Wrapper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* The end-all module detection/exportation | |
*/ | |
(function(base, factory) { | |
// RequireJS | |
if (typeof define === "function" && define.amd) { | |
define(factory); | |
// CommonJS | |
} else if (typeof exports === "object") { | |
module.exports = factory(); | |
// Global Space | |
} else { | |
base.yourModule = factory(); | |
} | |
}(this, function() { | |
var yourModule = { | |
/* | |
*Your code/functionality here | |
*/ | |
}; | |
return someModule; | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment