Last active
January 4, 2016 00:09
-
-
Save anasnakawa/8540133 to your computer and use it in GitHub Desktop.
the tiniest module wrapper for CommonJs / AMD and the browser
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
// Tiniest Module Wrapper - (c) Anas Nakawa - <anas.nakawa {at} gmail.com> | |
// License: MIT (http://www.opensource.org/licenses/mit-license.php) | |
(function() { | |
function myLibrary() {}; | |
// CommonJs / Node | |
( typeof module !== "undefined" && module.exports && ( module.exports = myLibrary ) ) || | |
// AMD / RequireJs | |
( typeof define !== "undefined" && !define(function() { return myLibrary; }) ) || | |
// browser | |
( typeof window !== "undefined" && ( window.myLibrary = myLibrary ) ); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment