lib/messenger.js
function Messenger(namespace, options) {
  if (!(this instanceof Messenger)) {
    return new Messenger(namespace, options);
  }

  if (!namespace) {
    throw new Error('Cannot create Messenger without a namespace');
  }

  events.EventEmitter.call(this);

  this.namespace = namespace;
  this.options = merge(Object.create(Messenger.DEFAULTS), options || {});
  this.socketPath = this._getFileDescriptorPath(this.options.uid);

  this._init();
}
function Messenger(namespace, options) {
  if (!(this instanceof Messenger)) {
    return new Messenger(namespace, options);
  }

  if (!namespace) {
    throw new Error('Cannot create Messenger without a namespace');
  }

  events.EventEmitter.call(this);

  this.namespace = namespace;
  this.options = merge(Object.create(Messenger.DEFAULTS), options || {});
  this.socketPath = this._getFileDescriptorPath(this.options.uid);

  this._init();
}
function Messenger ( namespace , options ) { if ( ! ( this instanceof Messenger ) ) { return new Messenger ( namespace , options ) ; } if ( ! namespace ) { throw new Error ( 'Cannot create Messenger without a namespace' ) ; } events . EventEmitter . call ( this ) ; this . namespace = namespace ; this . options = merge ( Object . create ( Messenger . DEFAULTS ) , options || { } ) ; this . socketPath = this . _getFileDescriptorPath ( this . options . uid ) ; this . _init ( ) ; }
Creates an IPC messenger
@constructor
@param {string} namespace - prefix for unix socket file descriptors
@param {object} options - messenger configuration
Creates an IPC messenger