MCPcopy Create free account
hub / github.com/MigoXLab/coderio / detectPackageManager

Function detectPackageManager

src/utils/dependency-installer.ts:9–13  ·  view source on GitHub ↗
(cwd: string = process.cwd())

Source from the content-addressed store, hash-verified

7const require = createRequire(import.meta.url);
8
9export function detectPackageManager(cwd: string = process.cwd()): 'npm' | 'yarn' | 'pnpm' {
10 if (fs.existsSync(path.join(cwd, 'pnpm-lock.yaml'))) return 'pnpm';
11 if (fs.existsSync(path.join(cwd, 'yarn.lock'))) return 'yarn';
12 return 'npm';
13}
14
15export function isPackageInstalled(packageName: string): boolean {
16 try {

Callers 1

ensurePackageInstalledFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected