Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
5,419 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1 @@ | ||
lib-cov | ||
*.seed | ||
*.log | ||
*.csv | ||
*.dat | ||
*.out | ||
*.pid | ||
*.gz | ||
|
||
pids | ||
logs | ||
results | ||
|
||
npm-debug.log | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
language: node_js | ||
node_js: | ||
- "0.8" | ||
- "0.10" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
|
||
module.exports = function(grunt) { | ||
grunt.initConfig({ | ||
exec: { | ||
buildSrc: { | ||
cmd: 'node_modules/.bin/browserify --debug lib/counsell.js > build/counsell.js' | ||
}, | ||
buildTest: { | ||
cmd: 'node_modules/.bin/browserify --debug test/counsell.js > pages/testRunner/build/tests.js' | ||
}, | ||
runTest: { | ||
cmd: 'node_modules/.bin/mocha -R list' | ||
} | ||
}, | ||
uglify: { | ||
compress: { | ||
files: { | ||
'build/counsell.min.js': ['build/counsell.js'] | ||
}, | ||
options: { | ||
mangle: false, | ||
preserveComments: 'some', | ||
banner: '/**\n' + | ||
' * @license https://github.com/pllee/counsell/blob/master/LICENSE\n' + | ||
' */\n' | ||
} | ||
} | ||
} | ||
}); | ||
|
||
grunt.loadNpmTasks('grunt-exec'); | ||
grunt.loadNpmTasks('grunt-contrib-uglify'); | ||
grunt.registerTask('default', ['exec', 'uglify']); | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
counsell | ||
======== | ||
|
||
23 console aliases that work where supported and run on all browsers. console.time for IE. | ||
21 console aliases that work where supported and run on all browsers. console.time for IE. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
var counsell = require('./counsell'); | ||
|
||
window.counsell = counsell; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
var methods = ["debug", "error", "info", "log", "warn", "dir", "dirxml", "table", "trace", "assert", "count", "markTimeline", "profile", "profileEnd", "time", "timeEnd", "timeStamp", "group", "groupCollapsed", "groupEnd", "clear"], | ||
con = module.exports = {}, | ||
i, | ||
len = methods.length, | ||
emptyFn = function() {}, | ||
createConsoleFn, | ||
timeIds; | ||
|
||
|
||
|
||
if (typeof console === 'undefined') { | ||
for (i = 0; i < len; ++i) { | ||
con[methods[i]] = emptyFn; | ||
} | ||
} else { | ||
createConsoleFn = function(methodName) { | ||
if (console[methodName]) { | ||
return function() { | ||
return console[methodName].apply(console, arguments); | ||
}; | ||
} | ||
|
||
return emptyFn; | ||
}; | ||
|
||
for (i = 0; i < len; ++i) { | ||
con[methods[i]] = createConsoleFn(methods[i]); | ||
} | ||
|
||
//IE | ||
if(con.time === emptyFn) { | ||
timeIds = {}; | ||
|
||
con.time = function(id) { | ||
timeIds[id] = new Date().getTime(); | ||
}; | ||
|
||
con.timeEnd = function(id) { | ||
var millis = new Date().getTime() - timeIds[id]; | ||
delete timeIds.id; | ||
console.log('%s: %sms', id, millis); | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"name": "counsell", | ||
"version": "0.1.0", | ||
"description": "all console methods that run on all browsers and node", | ||
"main": "lib/counsell.js", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/pllee/counsell.git" | ||
}, | ||
"keywords": [ | ||
"console", | ||
"console.time" | ||
], | ||
"devDependencies": { | ||
"expect.js": "0.2.0", | ||
"mocha": "~1.11.0", | ||
"grunt-exec": "~0.4.2", | ||
"grunt-contrib-uglify": "~0.2.2", | ||
"browserify": "2.23.1", | ||
"grunt-cli": "~0.1.9" | ||
}, | ||
"testling": { | ||
"browsers": [ | ||
"ie6", | ||
"ie7", | ||
"ie8", | ||
"ie9", | ||
"firefox/3.0", | ||
"firefox/4.0", | ||
"firefox/19", | ||
"firefox/nightly", | ||
"chrome/24", | ||
"chrome/25", | ||
"chrome/canary", | ||
"opera/12", | ||
"opera/next", | ||
"safari/5.1", | ||
"safari/6.0", | ||
"iphone/6.0", | ||
"ipad/6.0" | ||
], | ||
"harness": "mocha", | ||
"files": "test/*.js" | ||
}, | ||
"scripts": { | ||
"test": "node_modules/.bin/mocha" | ||
}, | ||
"author": "Patrick Lee", | ||
"license": "MIT" | ||
} |
Oops, something went wrong.