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;
}
})()