Skip to content

Instantly share code, notes, and snippets.

View robinpoort's full-sized avatar

Robin Poort robinpoort

View GitHub Profile
@cferdinandi
cferdinandi / vanilla-js-plugin.js
Created June 13, 2017 00:10
My starter template for vanilla JavaScript plugins.
(function (root, factory) {
if ( typeof define === 'function' && define.amd ) {
define([], factory(root));
} else if ( typeof exports === 'object' ) {
module.exports = factory(root);
} else {
root.myPlugin = factory(root);
}
})(typeof global !== 'undefined' ? global : this.window || this.global, function (root) {