Skip to content

Instantly share code, notes, and snippets.

@mathisonian
Created November 9, 2014 19:54
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mathisonian/72c97b7d3a970328bba7 to your computer and use it in GitHub Desktop.
Save mathisonian/72c97b7d3a970328bba7 to your computer and use it in GitHub Desktop.
exporting client side code
// 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