Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

making it npm-able

  • Loading branch information...
commit 0a709856b662736f93a5444d002d1c04d38cd4bd 1 parent ccf1fab
@HenrikJoreteg authored
View
1  .gitignore
@@ -0,0 +1 @@
+.DS_Store
View
11 &log.js → andlog.js
@@ -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
5 node-test.js
@@ -0,0 +1,5 @@
+var logger = require("./&log");
+
+logger.log("hellow");
+
+console.log(logger);
View
11 package.json
@@ -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"
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.