Skip to content

Instantly share code, notes, and snippets.

@fliptopbox
Created July 17, 2019 13:57
Show Gist options
  • Save fliptopbox/064b549e2b81ecfe92c660d55c30678b to your computer and use it in GitHub Desktop.
Save fliptopbox/064b549e2b81ecfe92c660d55c30678b to your computer and use it in GitHub Desktop.
A boilerplate for the UML module
(function(root, factory, NS="myfunction") { if (typeof define === "function" && define.amd) { define([], factory); } else if (typeof exports === "object") { module.exports = factory(); } else { root[NS] = factory(); } })(this, function()
{
/*
myfunction
Tell the user what your function does.
And perhaps leave them a usage example
NOTE: don't forget to change NS="myfunction"
that appears in the UML decoration,
that is the modules default namespace
*/
return function () {
const value = helper();
return `Kilroy says ... "${value}"`
}
function helper () {
return "I was here ...";
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment