extensions/npm/src/preferred-pm.ts/findPreferredPM
export async function findPreferredPM(pkgPath: string): Promise<{ name: string, multiplePMDetected: boolean }> {
	const detectedPackageManagers: string[] = [];

	if (await isNPMPreferred(pkgPath)) {
		detectedPackageManagers.push('npm');
	}

	if (await isYarnPreferred(pkgPath)) {
		detectedPackageManagers.push('yarn');
	}

	if (await isPNPMPreferred(pkgPath)) {
		detectedPackageManagers.push('pnpm');
	}

	const pmUsedForInstallation: { name: string } | null = await whichPM(pkgPath);

	if (pmUsedForInstallation && !detectedPackageManagers.includes(pmUsedForInstallation.name)) {
		detectedPackageManagers.push(pmUsedForInstallation.name);
	}

	const multiplePMDetected = detectedPackageManagers.length > 1;

	return {
		name: detectedPackageManagers[0] || 'npm',
		multiplePMDetected
	};
}