Skip to content

readPackageManagerPin

readPackageManagerPin(projectRoot): PackageManagerPin | null

package.json’s packageManager field at projectRoot, parsed into {manager, version}. null when the file is absent/unparseable, the field is missing or malformed (no @, empty version), or its manager name isn’t one NODE_LOCKFILE_MANAGERS recognises — a repo can pin a tool this ladder doesn’t resolve (e.g. a future manager); that’s not this function’s problem, it just declines to match.

ParameterType
projectRootstring

PackageManagerPin | null