摘要:
var util = require("util"); //导入util模块var events = require("events"); //导入events模块module.exports = MyStream;function MyStream() { events.EventEmitter.call(this); //call方法使得MyStream对象继承了EventEmitter对象上的方法}util.inherits(MyStream, events.EventEmitter); //使用inherits方法MyStream.prototy 阅读全文