Created
November 9, 2014 19:54
-
-
Save mathisonian/72c97b7d3a970328bba7 to your computer and use it in GitHub Desktop.
exporting client side code
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
// export as a Node module, an AMD module or a global browser variable | |
if (typeof module !== 'undefined') { | |
module.exports = myModule; | |
} else if (typeof define === 'function' && define.amd) { | |
define(function() { | |
return myModule; | |
}); | |
} else { | |
window.myModule = myModule; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment