{"size": 426, "ext": "js", "max_stars_repo_path": "src/loader/get-global-module-dir.js", "max_stars_repo_name": "ardhi/aneka", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/loader/get-global-module-dir.js", "max_issues_repo_name": "ardhi/aneka", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/loader/get-global-module-dir.js", "max_forks_repo_name": "ardhi/aneka", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 35.5, "max_line_length": 116, "alphanum_fraction": 0.7253521127}
const globalDirs = require('global-dirs')
const path = require('path')
const pathResolve = require('../fs/path-resolve')

module.exports = function (moduleId) {
  try {
    return pathResolve(path.dirname(require.resolve(path.join(globalDirs.yarn.packages, moduleId, 'package.json'))))
  } catch (err) {
    return pathResolve(path.dirname(require.resolve(path.join(globalDirs.npm.packages, moduleId, 'package.json'))))
  }
}
