Created
December 19, 2013 10:44
-
-
Save vitalk/8037418 to your computer and use it in GitHub Desktop.
Unified Javascript module loader
This file contains 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
!(function(name, definition) { | |
var hasDefine = typeof define === 'function', | |
hasExports = typeof module !== 'undefined' && module.exports; | |
if (hasDefine) { | |
define(name, definition); | |
} else if (hasExports) { | |
module.exports = definition(); | |
} else { | |
this[name] = definition(); | |
} | |
}('name', function() { | |
'use strict'; | |
// Your code goes here... | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment