code: function favicon (path, options) {
    var opts = options || {}
  
    var icon // favicon cache
    var maxAge = calcMaxAge(opts.maxAge)
  
    if (!path) {
      throw new TypeError('path to favicon.ico is required')
    }
  
    if (Buffer.isBuffer(path)) {
      icon = createIcon(Buffer.from(path), maxAge)
    } else if (typeof path === 'string') {
      path = resolveSync(path)
    } else {
      throw new TypeError('path to favicon.ico must be string or buffer')
    }
  
    return function favicon (req, res, next) {
      if (getPathname(req) !== '/favicon.ico') {
        next()
        return
      }
  
      if (req.method !== 'GET' && req.method !== 'HEAD') {
        res.statusCode = req.method === 'OPTIONS' ? 200 : 405
        res.setHeader('Allow', 'GET, HEAD, OPTIONS')
        res.setHeader('Content-Length', '0')
        res.end()
        return
      }
  
      if (icon) {
        send(req, res, icon)
        return
      }
  
      fs.readFile(path, function (err, buf) {
        if (err) return next(err)
        icon = createIcon(buf, maxAge)
        send(req, res, icon)
      })
    }
  }
docs: Serves the favicon located by the given `path`.
  
  @public
  @param {String|Buffer} path
  @param {Object} [options]
  @return {Function} middleware