NPM.DepStats (NPM v0.6.0)

Copy Markdown View Source

Computes aggregate statistics across all dependencies.

Summary

Functions

Returns the average number of transitive dependencies.

Computes comprehensive stats from a lockfile.

Formats stats for display.

Returns the top N scopes by package count.

Functions

avg_deps(lockfile)

@spec avg_deps(map()) :: float()

Returns the average number of transitive dependencies.

compute(lockfile)

@spec compute(map()) :: map()

Computes comprehensive stats from a lockfile.

format(stats)

@spec format(map()) :: String.t()

Formats stats for display.

top_scopes(lockfile, n \\ 5)

@spec top_scopes(map(), non_neg_integer()) :: [{String.t(), non_neg_integer()}]

Returns the top N scopes by package count.