Skip to content

nodeManagerFor

nodeManagerFor(root, dir, has, readPackageManagerField): NodeManager | null

The node manager for a directory: the nearest packageManager field or lockfile, searching from dir up to (and including) root.

Returns null when nothing is found — the npm default for a bare package.json is the caller’s policy, not this function’s.

ParameterType
rootstring
dirstring
has(absPath) => boolean
readPackageManagerField(absPath) => unknown

NodeManager | null