Skip to content

Instantly share code, notes, and snippets.

@kamleshchandnani
Last active August 6, 2023 06:02
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kamleshchandnani/07c63f3d728672d91f97b69bbf700eed to your computer and use it in GitHub Desktop.
Save kamleshchandnani/07c63f3d728672d91f97b69bbf700eed to your computer and use it in GitHub Desktop.
// File log.js
(function (global, factory) {
if (typeof define === "function" && define.amd) {
define(["exports"], factory);
} else if (typeof exports !== "undefined") {
factory(exports);
} else {
var mod = {
exports: {}
};
factory(mod.exports);
global.log = mod.exports;
}
})(this, function (exports) {
"use strict";
function log() {
console.log("Example of UMD module system");
}
// expose log to other modules
exports.log = log;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment