Permalink
Browse files

Narwhal package. Right now it worst than 'test/jsdump', because prett…

…y print not available yet.
  • Loading branch information...
1 parent fd9c7d0 commit f158663eaa2c3d361dfafd845530a16fcbee6b9a @NV committed Jan 22, 2010
Showing with 29 additions and 9 deletions.
  1. +14 −9 console.js
  2. +15 −0 package.json
View
@@ -1,12 +1,12 @@
-if (typeof console === 'undefined') {
- /**
- * @see http://getfirebug.com/console.html
- */
- window.console = {};
-}
+(function(window){
+
+ if (typeof console === 'undefined') {
+ /**
+ * @see http://getfirebug.com/console.html
+ */
+ window.console = {};
+ }
-(function(){
-
console._output = console.log || window.opera && opera.postError || function dump (message) {
console.history = console.history || [];
return console.history.push(message);
@@ -194,4 +194,9 @@ if (typeof console === 'undefined') {
console._timers[name].end = end;
};
-})();
+ if (typeof require === 'function' && typeof exports !== 'undefined') {
+ exports.console = window.console;
+ console._output = require('system').print;
+ }
+
+})(this);
View
@@ -0,0 +1,15 @@
+{
+ "name": "console",
+ "author": {
+ "name": "Nikita Vasilyev",
+ "url": "http://elv1s.ru/"
+ },
+ "url": "http://github.com/NV/console.js",
+ "license": {
+ "name": "MIT",
+ "url": "http://www.opensource.org/licenses/mit-license.php"
+ },
+ "description": "console.log() and friends. Based on Firebug console API.",
+ "keywords": [ "logging", "debugging", "profiling", "testing" ],
+ "lib": "console"
+}

0 comments on commit f158663

Please sign in to comment.