多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
~~~ var events = require('events') var util = require('util') function Player() { events.call(this) } //继承events util.inherits(Player, events) var player = new Player() player.on('play', function () { console.log("play") }) player.on('stop', function () { console.log("stop") }) player.emit("play") ~~~