Permalink
Browse files

making it npm-able

  • Loading branch information...
1 parent ccf1fab commit 0a709856b662736f93a5444d002d1c04d38cd4bd @HenrikJoreteg committed Aug 15, 2012
Showing with 26 additions and 2 deletions.
  1. +1 −0 .gitignore
  2. +9 −2 &log.js → andlog.js
  3. +5 −0 node-test.js
  4. +11 −0 package.json
View
@@ -0,0 +1 @@
+.DS_Store
View
@@ -1,7 +1,14 @@
// follow @HenrikJoreteg and @andyet if you like this ;)
(function (window) {
var ls = window.localStorage,
- out = {};
+ out = {},
+ inNode = typeof process !== 'undefined';
+
+ if (inNode) {
+ module.exports = console;
+ return;
+ }
+
if (ls && ls.debug && window.console) {
out = window.console;
} else {
@@ -18,4 +25,4 @@
} else {
window.console = out;
}
-})(window); // make window a local var compression optimization.
+})(this); // make window a local var compression optimization.
View
@@ -0,0 +1,5 @@
+var logger = require("./&log");
+
+logger.log("hellow");
+
+console.log(logger);
View
@@ -0,0 +1,11 @@
+{
+ "name": "andlog",
+ "version": "0.0.2",
+ "author": "Henrik Joreteg <henrik@andyet.net>",
+ "description": "Super-simple, client-side CommonJS logging thingy",
+ "main": "andlog.js",
+ "repository": {
+ "type": "git",
+ "url": "git@github.com:HenrikJoreteg/andlog.git"
+ }
+}

0 comments on commit 0a70985

Please sign in to comment.