企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
~~~ 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") ~~~