{"size": 577, "ext": "js", "max_stars_repo_path": "packages/core/resolve-scripts/src/core/get_modules_dirs.js", "max_stars_repo_name": "sokolov11/resolve", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "packages/core/resolve-scripts/src/core/get_modules_dirs.js", "max_issues_repo_name": "sokolov11/resolve", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "packages/core/resolve-scripts/src/core/get_modules_dirs.js", "max_forks_repo_name": "sokolov11/resolve", "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": 22.1923076923, "max_line_length": 64, "alphanum_fraction": 0.6949740035}
import path from 'path'

import getMonorepoNodeModules from './get_monorepo_node_modules'

const getModulesDirs = ({ isAbsolutePath = false } = {}) => {
  const currentDir = process.cwd()

  const absoluteDirs = [
    path.resolve(currentDir, 'node_modules'),
    path.resolve(__dirname, '../../node_modules'),
    ...getMonorepoNodeModules()
  ]

  if (isAbsolutePath) {
    return absoluteDirs
  } else {
    const relativeDirs = absoluteDirs.map(absoluteDir =>
      path.relative(currentDir, absoluteDir)
    )

    return relativeDirs
  }
}

export default getModulesDirs
