{"size": 448, "ext": "js", "max_stars_repo_path": "packages/cra-template/template/scripts/utils.js", "max_stars_repo_name": "isabella232/cli-15", "max_stars_repo_stars_event_min_datetime": "2021-03-11T21:08:55.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-11T17:14:18.000Z", "max_issues_repo_path": "packages/create-atomic/templates/scripts/utils.js", "max_issues_repo_name": "coveo/cli", "max_issues_repo_issues_event_min_datetime": "2021-03-02T02:13:03.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T23:24:23.000Z", "max_forks_repo_path": "packages/create-atomic/templates/scripts/utils.js", "max_forks_repo_name": "isabella232/cli-15", "max_forks_repo_forks_event_min_datetime": "2021-03-18T01:52:34.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-15T18:54:13.000Z"}
{"max_stars_count": 13, "max_issues_count": 529, "max_forks_count": 11, "avg_line_length": 29.8666666667, "max_line_length": 69, "alphanum_fraction": 0.7075892857}
const appendCmdIfWindows = (cmd) =>
  `${cmd}${process.platform === 'win32' ? '.cmd' : ''}`;

const DEFAULT_PACKAGE_MANAGER = 'npm';

function getPackageManager(noCmd = false) {
  const firstUserAgent = /^\w+(?=\/)/;
  const packageManager =
    process.env['npm_config_user_agent'].match(firstUserAgent) ??
    DEFAULT_PACKAGE_MANAGER;
  return noCmd ? packageManager : appendCmdIfWindows(packageManager);
}

module.exports = {getPackageManager};
