Skip to content

Commit

Permalink
Added UMD wrapper, should work with browserify now
Browse files Browse the repository at this point in the history
  • Loading branch information
Damon Oehlman committed Mar 26, 2013
1 parent 655e9f0 commit 3cf2bbd
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
14 changes: 11 additions & 3 deletions crel.js
Expand Up @@ -34,8 +34,16 @@
*/

window.crel = (function(undefined){

// if the module has no dependencies, the above pattern can be simplified to
(function (root, factory) {
if (typeof exports === 'object') {
module.exports = factory();
} else if (typeof define === 'function' && define.amd) {
define(factory);
} else {
root.crel = factory();
}
}(this, function () {
// based on http://stackoverflow.com/questions/384286/javascript-isdom-how-do-you-check-if-a-javascript-object-is-a-dom-object
var isNode = typeof Node === 'object'
? function (object) { return object instanceof Node }
Expand Down Expand Up @@ -108,4 +116,4 @@ window.crel = (function(undefined){
crel["isNode"] = isNode;

return crel;
})();
}));
21 changes: 21 additions & 0 deletions package.json
@@ -0,0 +1,21 @@
{
"name": "crel",
"description": "A small, simple, and fast DOM creation utility",
"author": "Kory Nunn <knunn187@gmail.com>",
"tags": [
"DOM"
],
"version": "0.0.0",
"main": "crel.js",
"dependencies": {},
"devDependencies": {
},
"repository": {
"type": "git",
"url": "git://github.com/KoryNunn/crel.git"
},
"bugs": {
"url": "http://github.com/KoryNunn/crel/issues"
},
"contributors": []
}

0 comments on commit 3cf2bbd

Please sign in to comment.