docs: function PouchDBGenerator(PouchDB, defaultDirectory, options) {
    // Shamelessly stolen from https://github.com/pouchdb/pouchdb/blob/e11a863a80ef746aba0fc3a0e235dbdf2048db5d/packages/node_modules/pouchdb-core/src/setup.js#L58-L90.
  
    function PouchAlt(name, opts) {
      if (!(this instanceof PouchAlt)) {
        return new PouchAlt(name, opts);
      }
  
      opts = opts || {};
  
      if (name && typeof name === 'object') {
        opts = name;
        name = opts.name;
        delete opts.name;
      }
  
      opts = assign({}, PouchAlt.__defaults, opts);
  
      // If database endpoint is not remote we will use defaultDirectory as
      // prefix and defaultAdapter as adapter for it.
      if (
        name !== undefined &&
        name.indexOf('http') !== 0 &&
        name.indexOf('https') !== 0
      ) {
        if (!opts.db && options.defaultAdapter) {
          opts.db      = options.defaultAdapter;
          opts.adapter = 'leveldb-mobile';
        }
        if (!opts.prefix) {
          opts.prefix = defaultDirectory;
        }
      }
  
      // Workaround for https://github.com/pouchdb/pouchdb-size/issues/23.
      this._db_name = name;
  
      PouchDB.call(this, name, opts);
    }
  
    options = assign({}, options);
  
    inherits(PouchAlt, PouchDB);
  
    PouchAlt.preferredAdapters = PouchDB.preferredAdapters.slice();
    Object.keys(PouchDB).forEach(function (key) {
      if (!(key in PouchAlt) ) {
        PouchAlt[key] = PouchDB[key];
      }
    });
  
    PouchAlt.__defaults = assign({}, PouchDB.__defaults);
  
    PouchAlt.adapter = function (id, obj, addToPreferredAdapters) {
      if (obj.valid()) {
        PouchAlt.adapters[id] = obj;
        if (addToPreferredAdapters) {
          PouchAlt.preferredAdapters.push(id);
        }
      }
    };
  
    PouchAlt.plugin = function (obj) {
      if (typeof obj === 'function') { // function style for plugins
        obj(PouchAlt);
      } else if (typeof obj !== 'object' || Object.keys(obj).length === 0) {
        throw new Error('Invalid plugin: got \"' + obj + '\", expected an object or a function');
      } else {
        Object.keys(obj).forEach(function (id) { // object style for plugins
          PouchAlt.prototype[id] = obj[id];
        });
      }
      return PouchAlt;
    }
  
    PouchAlt.plugin(LeveldownAdapter);
  
    return PouchAlt;
  }