Skip to content

Instantly share code, notes, and snippets.

@dok
Created September 23, 2015 04:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dok/b4c1125f59c081de2fd2 to your computer and use it in GitHub Desktop.
Save dok/b4c1125f59c081de2fd2 to your computer and use it in GitHub Desktop.
Isomorphic module definition
(function() {
var root = this;
var name = 'dcss';
function dcss() {
}
var proto = {
};
proto.forEach(function(fn, key) {
dcss.prototype[key] = fn;
});
if (typeof exports !== 'undefined') {
if (typeof module !== 'undefined' && module.exports) {
exports = module.exports = expose;
}
exports[name] = expose;
} else {
root[name] = expose;
}
if (typeof define === 'function' && define.amd) {
define(name, [], function() {
return dcss;
});
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment