Skip to content

Instantly share code, notes, and snippets.

View bishopZ's full-sized avatar

Bishop Zareh bishopZ

View GitHub Profile
@bishopZ
bishopZ / gist:f44dca19d22b9de96958
Last active August 29, 2015 14:04
Require.js & CommonJS & Node compatible module creation
function(name, root, factory){
if (typeof define !== 'undefined' && define.amd) {
define(name, ['dependency'], factory);
} else if (typeof exports !== 'undefined') {
if (typeof module !== 'undefined' && module.exports) {
exports = module.exports = factory;
}
exports[name] = factory;
} else {
root[name] = factory;