Permalink
Browse files

Add Node.js support

  • Loading branch information...
1 parent 7df62fe commit 0a6ea5e621f296cfacb77e3435738d28f3c236b7 @RobLoach RobLoach committed Jul 8, 2016
Showing with 13 additions and 5 deletions.
  1. +5 −5 console.frog.js
  2. +3 −0 package.json
  3. +5 −0 test/index.js
View
@@ -7,13 +7,13 @@
*/
(function dothething() {
-
- if( !window.console ) {
- // Well... nothing really... let it be!
- return;
+ // Act on either the window.console, or the normal console.
+ var con = console;
+ if (typeof(window) !== 'undefined') {
+ con = window.console;
}
- window.console.frog = function() {
+ con.frog = function() {
var i,
css = "color: green";
View
@@ -3,6 +3,9 @@
"version": "1.0.1",
"description": "Log with a frog, its as simple as that!",
"main": "console.frog.js",
+"scripts": {
+ "test": "node test"
+},
"repository": {
"type": "git",
"url": "git+https://github.com/tholman/console-dot-frog.git"
View
@@ -0,0 +1,5 @@
+// Register the polyfill
+require('..');
+
+// Use console.frog
+console.frog('Ribbit!');

0 comments on commit 0a6ea5e

Please sign in to comment.