code: function RPCify (obj, opts) {
    if (!obj) return null
    if (!(this instanceof RPCify)) return new RPCify(obj, opts)
    opts = opts || {}
  
    var defaults = {
      skipPrivate: true,
      include: null,
      exclude: [],
      override: {},
      factory: null,
      name: null,
      access: function () { return true }
    }
  
    if (obj.__hyperpc) {
      this.opts = Object.assign(defaults, obj.__hyperpc, opts)
    } else if (obj.prototype && obj.prototype.__hyperpc) {
      this.opts = Object.assign(defaults, obj.prototype.__hyperpc, opts)
    } else if (!obj.prototype && Object.getPrototypeOf(obj) && Object.getPrototypeOf(obj).__hyperpc) {
      this.opts = Object.assign(defaults, Object.getPrototypeOf(obj).__hyperpc, opts)
    } else {
      this.opts = Object.assign(defaults, opts)
    }
  
    this.access = this.opts.access
    this.override = this.opts.override
    this.cache = {}
  
    if (obj.prototype) {
      // 1. Class (prototype)
  
      if (opts.factory) this.factory = opts.factory
      else this.factory = makeDefaultFactory(obj)
  
      this.instance = null
      this.name = obj.name
      this.funcs = getAllFuncs(obj.prototype)
    } else {
      // 2. Object instance
  
      this.factory = null
      this.instance = obj
      this.name = Object.getPrototypeOf(obj).name
      this.funcs = getAllFuncs(obj)
    }
  
    var out = ['constructor']
    if (this.opts.exclude) out = out.concat(this.opts.exclude)
  
    this.filteredFuncs = this.funcs.filter(f => {
      if (this.opts.include && this.opts.include.indexOf(f) === -1) return false
      if (out.indexOf(f) !== -1) return false
      if (this.opts.skipPrivate && f.substr(0, 1) === '_') return false
      return true
    })
  }
docs: var debug = require('debug')('rpcify')