docs: function getDetails(filepath, options) {
    options = Object.assign({ sources: [] }, options);
  
    const { browser, cache, fileExtensions, sources } = options;
    const cwd = process.cwd();
    const pkgpath = resolvePath(filepath);
    let details;
  
    // Pull from cache
    if ((details = cache.getPackage(pkgpath))) return details;
  
    const pkgname = resolveName(pkgpath);
    // Gather all reachable paths
    const paths = [...resolveNodeModules(pkgpath), ...sources];
    const type = filepathType(filepath, fileExtensions) || 'js';
    let manifestpath = path.resolve(pkgpath, 'package.json');
    const isRoot = path.dirname(manifestpath) == cwd;
    let isNestedProjectPackage = false;
  
    // Default to root manifest for nested (proxy) packages
    if (!pkgpath.includes('node_modules') && !exists(manifestpath)) {
      manifestpath = path.resolve(cwd, 'package.json');
      isNestedProjectPackage = true;
    }
  
    details = {
      aliases: {},
      dirname: path.dirname(pkgpath),
      id: pkgname,
      isNestedProjectPackage,
      isNpmPackage: !isRoot && !isNestedProjectPackage,
      manifestpath: '',
      main: '',
      name: pkgname,
      paths,
      pkgpath,
      version: '1.0.0'
    };
  
    // Parse manifest
    let json;
  
    try {
      json = require(manifestpath);
    } catch (err) {
      /* not found  */
    }
  
    if (json) {
      const manifestRoot = path.dirname(manifestpath);
  
      details.manifestpath = manifestpath;
      details.name = (details.id = json.name || pkgname);
      details.version = json.version;
      details.main = findFilepath(path.join(manifestRoot, json.main || 'index.js'), type, fileExtensions);
      // Resolve json.browser aliasing
      if (json.browser && browser) {
        if ('string' == typeof json.browser) {
          details.main = path.join(manifestRoot, json.browser);
        } else {
          details.aliases = Object.assign(details.aliases, alias.parse(manifestRoot, json.browser, type, fileExtensions));
          // Handle 'main' aliasing
          for (const key in details.aliases) {
            if (key == details.main) details.main = details.aliases[key];
          }
        }
      }
      // Store main as alias
      if (details.main) {
        details.aliases[manifestRoot] = details.main;
        details.aliases[details.id] = details.main;
      }
      // Reset if nested
      if (isNestedProjectPackage) {
        details.main = (details.manifestpath = (details.version = ''));
        details.name = (details.id = details.name + pkgname.slice(pkgname.indexOf(path.sep)));
      }
    }
  
    // Handle scoped
    if (path.basename(details.dirname).indexOf('@') == 0) details.dirname = path.dirname(details.dirname);
    // Append version number if multiple versions exist
    if (cache.getPackage(details.id)) details.id += versionDelimiter + details.version;
  
    // Cache
    cache.setPackage(details);
  
    return details;
  }