function opts(app, name) {
  var paths = app.config.get('templates');
  var defaults = app.option('defaults.templates');
  var res = { cwd: process.cwd(), cache: true };

  if (paths && paths.hasOwnProperty(name)) {
    res.cwd = utils.tryRequire(paths[name]);
    if (res.cwd) return res;
    res.cwd = path.resolve(process.cwd(), paths[name]);
    if (res.cwd) return res;
  }

  if (defaults.hasOwnProperty(name)) {
    res.cwd = utils.tryRequire(defaults[name]);
    if (res.cwd) return res;
    res.cwd = path.resolve(process.cwd(), defaults[name]);
  }
  return res;
}
Pre-load templates for built-in template types:
  | examples
  | includes
  | badges
  | docs