Last active
April 9, 2018 14:32
-
-
Save varemenos/ae0e8b208b31e39c065d to your computer and use it in GitHub Desktop.
Sample Javascript module boilerplate
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 (root, name, factory) { | |
'use strict'; | |
if (typeof define === 'function' && define.amd) { | |
define(factory); | |
} else if (typeof exports === 'object') { | |
module.exports = factory; | |
} else { | |
root[name] = factory(); | |
} | |
})(this, 'myFunc', function () { | |
'use strict'; | |
var myFunc = function () {}; | |
return myFunc; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment