detectPackageManager
detectPackageManager(
dir,options?):PackageManager
Defined in: detect-package-manager.ts:44
The package manager dir uses: the name in package.json#packageManager
(pnpm@10.0.0 → pnpm) when it’s one of pnpm, npm, yarn or bun, else the
first lockfile found (pnpm-lock.yaml, bun.lockb, bun.lock, yarn.lock, npm-shrinkwrap.json,
package-lock.json, in that order), else options.fallback.
Parameters
Section titled “Parameters”string
options?
Section titled “options?”DetectPackageManagerOptions = {}
Returns
Section titled “Returns”Example
Section titled “Example”import { detectPackageManager } from "@theholocron/pkg-utils";
detectPackageManager(process.cwd()); // "pnpm" | "npm" | "yarn" | "bun"