index.js
function (opt) {
    EventEmitter.call(this);

    opt = opt || {};

    // the id of the service that the node will provide
    this._service = opt.service || 'unnamedService';

    // cluster which the node belongs to
    this._cluster = opt.cluster || 'defaultCluster';

    // id of the node
    this._id      = opt.id || uuid.v4();

    // port in which the node will be publishing messages
    this._pubPort = opt.port; // if port is not defined, a free one is used

    // interface in which the node will bind
    this._address = opt.address || '0.0.0.0';

    // status flags
    this._inCluster   = false;
    this._advertising = false;

    // used to store information about the other nodes in the cluster
    this._clusterTopology = {};

    // pub and sub sockets
    this._pub = null;
    this._sub = null;

    // mdns advertiser/browser
    this._ad      = null;
    this._browser = null;

    // information that is used to advertise the service
    this._adInfo  = null;
}
function (opt) {
    EventEmitter.call(this);

    opt = opt || {};

    // the id of the service that the node will provide
    this._service = opt.service || 'unnamedService';

    // cluster which the node belongs to
    this._cluster = opt.cluster || 'defaultCluster';

    // id of the node
    this._id      = opt.id || uuid.v4();

    // port in which the node will be publishing messages
    this._pubPort = opt.port; // if port is not defined, a free one is used

    // interface in which the node will bind
    this._address = opt.address || '0.0.0.0';

    // status flags
    this._inCluster   = false;
    this._advertising = false;

    // used to store information about the other nodes in the cluster
    this._clusterTopology = {};

    // pub and sub sockets
    this._pub = null;
    this._sub = null;

    // mdns advertiser/browser
    this._ad      = null;
    this._browser = null;

    // information that is used to advertise the service
    this._adInfo  = null;
}
------------------------------ CONSTRUCTOR ----------------------------------