Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Added UMD wrapper, should work with browserify now #5

Merged
merged 1 commit into from

2 participants

@DamonOehlman

No description provided.

@KoryNunn
Owner

I won't fine much use in the AMD support, but I guess for a few bytes it's OK.

@KoryNunn KoryNunn merged commit 50123f4 into KoryNunn:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 26, 2013
  1. @DamonOehlman
This page is out of date. Refresh to see the latest.
Showing with 32 additions and 3 deletions.
  1. +11 −3 crel.js
  2. +21 −0 package.json
View
14 crel.js
@@ -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 }
@@ -108,4 +116,4 @@ window.crel = (function(undefined){
crel["isNode"] = isNode;
return crel;
-})();
+}));
View
21 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": []
+}
Something went wrong with that request. Please try again.