Skip to content

Commit

Permalink
Add browserify support. Clean up package.
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Hamilton committed Nov 27, 2012
1 parent 5f292b0 commit 2af7e28
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 20 deletions.
9 changes: 4 additions & 5 deletions dist/browser-cuid.js
Expand Up @@ -10,9 +10,7 @@
* MIT License
*/

/*global window, navigator, document, require, process*/
var global = global || this, module = module || undefined;

/*global window, navigator, document, require, process, module */
(function (app) {
'use strict';
var namespace = 'cuid',
Expand Down Expand Up @@ -88,9 +86,10 @@ var global = global || this, module = module || undefined;
// don't change anything from here down.
if (app.register) {
app.register(namespace, api);
} else if (typeof module !== 'undefined') {
module.exports = api;
} else {
namespace = app.exports ? 'exports' : namespace;
app[namespace] = api;
}

}(global.applitude || module || this));
}(this.applitude || this));
9 changes: 4 additions & 5 deletions dist/node-cuid.js
Expand Up @@ -10,9 +10,7 @@
* MIT License
*/

/*global window, navigator, document, require, process*/
var global = global || this, module = module || undefined;

/*global window, navigator, document, require, process, module */
(function (app) {
'use strict';
var namespace = 'cuid',
Expand Down Expand Up @@ -83,9 +81,10 @@ var global = global || this, module = module || undefined;
// don't change anything from here down.
if (app.register) {
app.register(namespace, api);
} else if (typeof module !== 'undefined') {
module.exports = api;
} else {
namespace = app.exports ? 'exports' : namespace;
app[namespace] = api;
}

}(global.applitude || module || this));
}(this.applitude || this));
3 changes: 2 additions & 1 deletion grunt.js
Expand Up @@ -46,6 +46,7 @@ module.exports = function(grunt) {
"node-cuid": ['test/node-cuid-test.js']
}
});
grunt.registerTask('default', 'concat lint qunit test');
grunt.registerTask('testall', 'qunit test');
grunt.registerTask('default', 'concat lint');
grunt.registerTask('install', 'concat');
};
8 changes: 4 additions & 4 deletions package.json
@@ -1,12 +1,13 @@
{
"name": "cuid",
"version": "1.1.6",
"version": "1.1.7",
"description": "Collission-resistant ids optimized for horizontal scaling and performance. For node and browsers.",
"author": {
"name": "Eric Elliott",
"url": "http://ericleads.com"
},
"main": "./dist/node-cuid.js",
"browserify": "./dist/browser-cuid.js",
"keywords": [
"uid",
"unique id",
Expand All @@ -23,13 +24,12 @@
"src": "./src",
"test": "./test"
},
"dependencies": {
"devDependencies": {
"applitude": "~0.x.x",
"grunt": "~0.3.x"
},
"scripts": {
"postinstall": "grunt install",
"test": "grunt"
"test": "grunt testall"
},
"engines": {
"node": "~0.x.x"
Expand Down
5 changes: 3 additions & 2 deletions src/footer.js
Expand Up @@ -2,9 +2,10 @@
// don't change anything from here down.
if (app.register) {
app.register(namespace, api);
} else if (typeof module !== 'undefined') {
module.exports = api;
} else {
namespace = app.exports ? 'exports' : namespace;
app[namespace] = api;
}

}(global.applitude || module || this));
}(this.applitude || this));
4 changes: 1 addition & 3 deletions src/head.js
Expand Up @@ -10,9 +10,7 @@
* MIT License
*/

/*global window, navigator, document, require, process*/
var global = global || this, module = module || undefined;

/*global window, navigator, document, require, process, module */
(function (app) {
'use strict';
var namespace = 'cuid',
Expand Down

0 comments on commit 2af7e28

Please sign in to comment.