code: function PhotoshopClient(options, connectListener, logger) {
          var self = this;
          
          if (!(self instanceof PhotoshopClient)) {
              return new PhotoshopClient(options, connectListener, logger);
          } else {
              var password = DEFAULT_PASSWORD;
              
              if (options.hasOwnProperty("password")) { password = options.password; }
              if (options.hasOwnProperty("port")) { self._port = options.port; }
              if (options.hasOwnProperty("hostname")) { self._hostname = options.hostname; }
              if (options.hasOwnProperty("inputFd")) { self._inputFd = options.inputFd; }
              if (options.hasOwnProperty("outputFd")) { self._outputFd = options.outputFd; }
              
              self._logger = logger;
              self._receiveBuffer = new Buffer(INITIAL_MESSAGE_BUFFER_SIZE);
              self._receivedBytes = 0;
              self._writeQueue = [];
              
              if (connectListener) {
                  this.once("connect", connectListener);
              }
              
              var connectionPromise = null;
              var cryptoPromise = null;
              
              if ((typeof self._inputFd === "number" && typeof self._outputFd === "number") ||
                  (typeof self._inputFd === "string" && typeof self._outputFd === "string")) {
                  connectionPromise = self._connectPipe();
                  var cryptoDeferred = Q.defer();
                  cryptoDeferred.resolve();
                  cryptoPromise = cryptoDeferred.promise;
              } else if (self._hostname && typeof self._port === "number") {
                  connectionPromise = self._connectSocket();
                  cryptoPromise = self._initCrypto(password);
              } else {
                  var connectionDeferred = Q.defer();
                  connectionDeferred.reject();
                  connectionPromise = connectionDeferred.promise;
              }
              
              Q.all([
                  connectionPromise,
                  cryptoPromise
              ]).done(
                  function () {
                      self.emit("connect");
                  },
                  function (err) {
                      self.emit("error", err);
                      self.disconnect();
                  }
              );
          }
      }
docs: PhotoshopClient Class
  
  @constructor