lib/telepathy.js
function Telepathy(options) {
  'use strict';

  options = options || {};

  if (typeof options == 'string')
    options = { secret: options };

  /** Private variable shared secret */
  var _secret = options.secret || '';
  delete options.secret;

  this.user = options.user || '';
  this.alphabet = options.alphabet || Telepathy.alphabet.base62;
  this.length = options.length || 10;
  this.domain = options.domain || '';
  this.algorithm = options.algorithm || 'SHA256';

  /**
   * Set the private secret we'll be using in generating passwords
   * @param {string} secret
   */
  this.setSecret = function(secret) {
    _secret = secret || '';
  };

  /**
   * Generate a password
   * @param {object|string|number} [options]
   * @returns {string} Generated password
   * @example
   * var telepathy = new Telepathy('secret');
   * console.log(telepathy.password('google.com'));
   */
  this.password = function(options) {
    return this._password(_secret, options);
  };
}
function Telepathy(options) {
  'use strict';

  options = options || {};

  if (typeof options == 'string')
    options = { secret: options };

  /** Private variable shared secret */
  var _secret = options.secret || '';
  delete options.secret;

  this.user = options.user || '';
  this.alphabet = options.alphabet || Telepathy.alphabet.base62;
  this.length = options.length || 10;
  this.domain = options.domain || '';
  this.algorithm = options.algorithm || 'SHA256';

  /**
   * Set the private secret we'll be using in generating passwords
   * @param {string} secret
   */
  this.setSecret = function(secret) {
    _secret = secret || '';
  };

  /**
   * Generate a password
   * @param {object|string|number} [options]
   * @returns {string} Generated password
   * @example
   * var telepathy = new Telepathy('secret');
   * console.log(telepathy.password('google.com'));
   */
  this.password = function(options) {
    return this._password(_secret, options);
  };
}
Telepathy constructor
@constructor
@param {object|string} [options]