1.0.0 • Published 9 years ago

on-everything v1.0.0

Weekly downloads
1
License
MIT
Repository
-
Last release
9 years ago

on-everything

Catch every event an EventEmitter publishes.

Use

$ npm install --save on-everything
var onEverything = require('on-everything');

Example

var onEverything = require('on-everything');
var request = require('request');

onEverything(request('http://yahoo.com'), function (eventName) {
  console.log(eventName);
});
$ node ./
request
socket
redirect
request
socket
response
complete
end

ee = onEverything(ee, onEvent);

ee

Type: EventEmitter

This is returned from the function to allow chaining.

onEvent(eventName, ...)

Type: Function

Called on every emitted event.

eventName

Name of the event emitted.

...

The original arguments passed to the event.

Related