Build and query a dependency tree from the lockfile.
Provides a structured view of the dependency graph, useful
for mix npm.tree, mix npm.why, and deduplication.
Summary
Functions
Build a dependency tree from the lockfile.
Count total unique packages in the tree.
Get the depth of a package in the tree (0 = root dep).
Flatten the tree into a list of all package names.
Find all paths from root to a target package.
Types
Functions
@spec build(%{required(String.t()) => NPM.Lockfile.entry()}, %{ required(String.t()) => String.t() }) :: [ tree_node() ]
Build a dependency tree from the lockfile.
Returns a list of root-level nodes, each with their transitive dependencies as children.
@spec count([tree_node()]) :: non_neg_integer()
Count total unique packages in the tree.
@spec depth([tree_node()], String.t()) :: non_neg_integer() | nil
Get the depth of a package in the tree (0 = root dep).
Flatten the tree into a list of all package names.
Find all paths from root to a target package.