dhruvbird/eventpipe
An Event Pipe for node.js
{ "createdAt": "2011-06-05T17:09:13Z", "defaultBranch": "master", "description": "An Event Pipe for node.js", "fullName": "dhruvbird/eventpipe", "homepage": "", "language": "JavaScript", "name": "eventpipe", "pushedAt": "2012-05-16T14:13:59Z", "stargazersCount": 7, "topics": [], "updatedAt": "2021-10-30T00:49:08Z", "url": "https://github.com/dhruvbird/eventpipe"}See the file test.js for details on usage
- API is the same as node.js’ EventEmitter http://nodejs.org/docs/v0.4.2/api/events.html
- Drop-In replacement for node.js’ EventEmitter except in cases when the listener function returns something or the array returned by the listeners() function is directly manipulated (see conditions 6-9)
- Additional ‘priority’ parameter in addListener (or on) specifies when to call handler
- Listeners are called in non-decreasing order of priority (listeners with a lesser numerical priority are called first)
- Listeners with the same priority are called in any order
- Returning an array or an array-like object will cause that object to be passed on to the next listener
- Returning nothing (undefined) causes the arguments to the current listener to be used for the next one
- Returning false terminates the piped calling of listeners (the listener returning false will be the last one to be called)
- The array returned by listeners() function is not an array of functions. Instead it contains objects of the type { priority: PRIO, proc: PROC }. Please avoid using/manipulaiting it directly. Instead use all the nice functions given to you
- All listeners with a given priority may not be called if any one of them returns false