Skip to content

pnpm Facts

Facts for pnpm, the fast, disk space efficient Node.js package manager. See https://pnpm.io/

Facts taking a directory run pnpm inside it rather than under pnpm's --dir, so corepack - which resolves the pnpm version from the working directory - picks up the project's packageManager pin.

See also: operations/pnpm.

pnpm.PnpmModulesUpToDate

host.get_fact(PnpmModulesUpToDate, directory)

Returns whether a project's node_modules was installed from the pnpm-lock.yaml now in the directory.

pnpm keeps the lockfile it installed at node_modules/.pnpm/lock.yaml, so the two matching means the packages on disk are the ones the lockfile asks for - though not that package.json agrees with the lockfile.

pnpm.PnpmPackages

host.get_fact(PnpmPackages, directory=None)

Returns a dict of installed pnpm packages, globally or in a given directory:

{
    "package_name": {"version"},
}

Only packages the manifest declares are reported.

pnpm.PnpmVersion

host.get_fact(PnpmVersion)

Returns the version of pnpm installed:

"10.15.1"