console-monkey-patch
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "console-monkey-patch", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Node.js module monkeypatching the console object", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -12,12 +12,12 @@ # console-monkey-patch | ||
https://nodejs.org/api/console.html#console_class_console): | ||
```lang=js | ||
```javascript | ||
var fs = require("fs"); | ||
var newstdout = fs.createWriteStream('/some/path', {flags: 'a'}); | ||
var newstderr = fs.createWriteStream('/some/other/path', {flags: 'a'}); | ||
var newcons = new console.Console(newstdout, newstdout); | ||
var newstdout = fs.createWriteStream('/tmp/stdout.log', {flags: 'a'}); | ||
var newstderr = fs.createWriteStream('/tmp/stderr.log', {flags: 'a'}); | ||
var newcons = new console.Console(newstdout, newstderr); | ||
require("console-monkey-patch")(newcons); | ||
console.log('this should go to /some/path'); | ||
console.error('this should go to /some/other/path'); | ||
console.log('this should go to /tmp/stdout.log'); | ||
console.error('this should go to /tmp/stderr.log'); | ||
``` | ||
@@ -24,0 +24,0 @@ |
3257