Collects statistics about the project's npm dependencies.
Provides aggregate insights: package counts, version freshness, dependency types, maintainer diversity, etc.
Summary
Functions
Computes statistics from a lockfile and root dependencies.
Returns the dependency-to-package ratio (how connected the graph is).
Finds the most depended-upon packages (highest fan-in).
Computes version distribution across the lockfile.
Types
@type project_stats() :: %{ total_packages: non_neg_integer(), direct_deps: non_neg_integer(), transitive_deps: non_neg_integer(), with_install_scripts: non_neg_integer(), avg_dep_count: float(), max_dep_chain: non_neg_integer(), scoped_packages: non_neg_integer() }
Functions
@spec compute(map(), map()) :: project_stats()
Computes statistics from a lockfile and root dependencies.
Returns the dependency-to-package ratio (how connected the graph is).
@spec most_depended(map(), non_neg_integer()) :: [{String.t(), non_neg_integer()}]
Finds the most depended-upon packages (highest fan-in).
@spec version_distribution(map()) :: %{required(String.t()) => non_neg_integer()}
Computes version distribution across the lockfile.
Returns a map of major version buckets.