Package Exports
- console.mute
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (console.mute) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
console.mute
Temporarily mute console.log in node.js. Resume and retrieve logged data later. Useful for intercepting logged data from any module and when testing modules that insist on logging all the things. Based on this gist. Here's a gist that works in the browser.
Install
$ npm install console.muteUsage
require('console.mute'); // adds mute and resume to console
console.log('a'); // will log
console.mute(); // mutes log
console.log('b'); // will not log
console.log('c'); // will not log
var data = console.resume(); // resumes log and returns logged data during mute
console.log('d'); // will log
console.log(data); // logs ['b', 'c']Test
$ npm testTodo
- mute console.error et al
Licence
MIT