MCPcopy Create free account
hub / github.com/dmno-dev/bumpy / isPackageInstalled

Function isPackageInstalled

packages/bumpy/src/commands/init.ts:190–197  ·  view source on GitHub ↗
(rootDir: string, pkgName: string)

Source from the content-addressed store, hash-verified

188}
189
190async function isPackageInstalled(rootDir: string, pkgName: string): Promise<boolean> {
191 try {
192 const pkg = await readJson<Record<string, Record<string, string>>>(resolve(rootDir, 'package.json'));
193 return !!(pkg.devDependencies?.[pkgName] || pkg.dependencies?.[pkgName]);
194 } catch {
195 return false;
196 }
197}
198
199async function installPackage(pm: string, pkgName: string, rootDir: string): Promise<void> {
200 const cmd = `${PM_ADD_DEV[pm] || 'npm install -D'} ${pkgName}`;

Callers 1

initCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…