@capgo/find-package-manager
Advanced tools
Comparing version 0.0.14 to 0.0.15
export type PackageManagerType = 'yarn' | 'npm' | 'bun' | 'pnpm' | 'unknown'; | ||
export type InstallCommand = 'install' | 'add'; | ||
export function findPackageManagerType (path?: string, defaultPackageManager?: string): PackageManagerType; | ||
export type PackageManagerRunner = 'yarn dlx' | 'npx' | 'bunx' | 'pnpm exec'; | ||
export function findPackageManagerType (path?: string, defaultPackageManager?: PackageManagerType): PackageManagerType; | ||
export function findInstallCommand (packageManagerType?: PackageManagerType): InstallCommand; | ||
export function findPackageManagerRuuner (path?: string, defaultPackageManagerRunner?: PackageManagerRunner); |
20
main.js
@@ -39,2 +39,22 @@ import { existsSync } from 'fs'; | ||
} | ||
export const findPackageManagerRuuner = (path = '.', defaultPackageManagerRunner = 'npx') => { | ||
const bunPath = `${path}/bun.lockb`; | ||
const pnpmPath = `${path}/pnpm-lock.yaml`; | ||
const yarnPath = `${path}/yarn.lock`; | ||
const npmPath = `${path}/package-lock.json`; | ||
if (existsSync(bunPath)) { | ||
return 'bunx' | ||
} | ||
if (existsSync(pnpmPath)) { | ||
return 'pnpm exec' | ||
} | ||
if (existsSync(yarnPath)) { | ||
return 'yarn dlx' | ||
} | ||
if (existsSync(npmPath)) { | ||
return 'npx' | ||
} | ||
return defaultPackageManagerRunner | ||
} | ||
// console.log('findPackageManagerType', findPackageManagerType()) |
@@ -5,3 +5,3 @@ { | ||
"public": true, | ||
"version": "0.0.14", | ||
"version": "0.0.15", | ||
"license": "MIT", | ||
@@ -8,0 +8,0 @@ "description": "Live update for capacitor apps", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3206
62