In fact, it is enough to inherit the EventEmitter of events, and then you can register the event through on; emit to trigger the event, and removeListener to remove the event. The simple example is as follows:
var util = require('util');var Et = require('events').EventEmitter;function Ticker() { var self = this; setInterval(function(){self.emit("tick")},1000);}util.inherits(Tick,Et);var ticker = new Ticker();ticker.on("tick",function() { console.log("ticker");});In this way, custom Ticker has the ability to customize events