Last active
August 29, 2015 14:14
-
-
Save sirlancelot/56c5108fc2bdeef0fb4d to your computer and use it in GitHub Desktop.
Module definition compatible for use in Node.js & Browser environments.
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
// Defines a module that works in Node & Browsers | |
(function(global, factory) { | |
var mock = { exports: {} } | |
var local = (typeof module === "object" && module.exports) ? module : mock | |
factory(local, local.exports) | |
if (local === mock) global["yourNamespaceHere"] = local.exports | |
}(this, function(module, exports) { | |
"use strict"; | |
// Add your work to `exports` or `module.exports` | |
})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment