console-monkey-patch
Advanced tools
Comparing version 1.0.1 to 1.0.2
10
index.js
@@ -5,2 +5,7 @@ "use strict"; | ||
// the methods we can patch | ||
var methods = [ | ||
'log', 'info', 'error', 'warn', 'dir', 'time', 'timeEnd', 'trace', 'assert' | ||
]; | ||
/* | ||
@@ -11,6 +16,3 @@ * patch all the console stuff documented at https://nodejs.org/api/console.html | ||
if (newcons) { | ||
[ | ||
'log', 'info', 'error', 'warn', 'dir', 'time', 'timeEnd', 'trace', | ||
'assert' | ||
].forEach(function (n) { | ||
methods.forEach(function (n) { | ||
if (newcons[n] instanceof Function) | ||
@@ -17,0 +19,0 @@ console[n] = newcons[n]; |
{ | ||
"name": "console-monkey-patch", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Node.js module monkeypatching the console object", | ||
@@ -19,4 +19,4 @@ "main": "index.js", | ||
"devDependencies": { | ||
"mocha": "~2.3.3" | ||
"mocha": "~3.4.2" | ||
} | ||
} |
@@ -0,1 +1,3 @@ | ||
[![Build Status](https://travis-ci.org/NetOxygen/console-monkey-patch.svg?branch=master)](https://travis-ci.org/NetOxygen/console-monkey-patch) | ||
# console-monkey-patch | ||
@@ -9,2 +11,5 @@ Hack the console object methods (like log, error, info etc.). | ||
## Installation | ||
npm install console-monkey-patch | ||
## Simple example | ||
@@ -11,0 +16,0 @@ The most simple example is to create a new `console.Console` object (see |
3551
6
19
37