diff --git a/extensions/npm/README.md b/extensions/npm/README.md index 296bf03f73e..215ca927ff4 100644 --- a/extensions/npm/README.md +++ b/extensions/npm/README.md @@ -34,7 +34,7 @@ The extension fetches data from and { + if (await pathExists(path.join(pkgPath, 'bun.lockb'))) { + return { isPreferred: true, hasLockfile: true }; + } + + return { isPreferred: false, hasLockfile: false }; +} + async function isPNPMPreferred(pkgPath: string): Promise { if (await pathExists(path.join(pkgPath, 'pnpm-lock.yaml'))) { return { isPreferred: true, hasLockfile: true }; @@ -78,6 +86,12 @@ export async function findPreferredPM(pkgPath: string): Promise<{ name: string; detectedPackageManagerProperties.push(yarnPreferred); } + const bunPreferred = await isBunPreferred(pkgPath); + if (bunPreferred.isPreferred) { + detectedPackageManagerNames.push('bun'); + detectedPackageManagerProperties.push(bunPreferred); + } + const pmUsedForInstallation: { name: string } | null = await whichPM(pkgPath); if (pmUsedForInstallation && !detectedPackageManagerNames.includes(pmUsedForInstallation.name)) {