npm.io
0.0.1 • Published 11 years ago

console-emitter

Licence
MIT
Version
0.0.1
Deps
0
Vulns
0
Weekly
0

Console Emitter

Implementation of the console API which emits appropriate events on all method calls.

NPM Module

Build Status Coverage Status

Usage

The Console class is implements the same interface as the NodeJS console API. Each console method is emitted as an event with the same name.

var Console = require('console-emitter');

var console = new Console();

console.on('log', logme);
console.log('1', '2', '3');
function logme(one, two, three) {
  global.console.log(' one:', one);
  global.console.log(' two:', two);
  global.console.log(' three:', three);
}
// Prints
//  one: 1
//  two: 2
//  three: 3

Keywords