nci/lib/command/base.js

27 lines
532 B
JavaScript
Raw Normal View History

2014-05-10 10:19:47 +00:00
'use strict';
var EventEmitter = require('events').EventEmitter,
inherits = require('util').inherits;
function Command(params) {
params = params || {};
this.emitIn = params.emitIn;
2014-12-14 20:04:00 +00:00
this.emitOut = params.emitOut;
2015-06-28 14:47:34 +00:00
this.emitErr = params.emitErr;
this.attachStderr = params.attachStderr;
2014-05-10 10:19:47 +00:00
}
exports.Command = Command;
2014-05-10 10:19:47 +00:00
inherits(Command, EventEmitter);
Command.prototype.enableEmitter = function() {
2014-12-14 20:04:00 +00:00
this.emitOut = true;
2014-05-10 10:19:47 +00:00
return this;
};
Command.prototype.disableEmitter = function() {
2014-12-14 20:04:00 +00:00
this.emitOut = false;
2014-05-10 10:19:47 +00:00
return this;
};