JS Utils Kit
    Preparing search index...

    Interface DetectPMOptions

    Options for detectPM

    interface DetectPMOptions {
        cwd?: string;
        lockfile?: boolean;
        packageJson?: boolean;
    }
    Index

    Properties

    cwd?: string

    Working directory where package manager detection should occur.

    process.cwd().

    lockfile?: boolean

    Whether to detect the package manager using lockfiles.

    Supported lockfiles:

    • package-lock.json → npm
    • pnpm-lock.yaml → pnpm
    • yarn.lock → yarn
    • bun.lock or bun.lockb → bun
    true
    
    packageJson?: boolean

    Whether to inspect package.json for the packageManager field.

    Example:

    {
    "packageManager": "pnpm@10.30.3"
    }
    true