NPM.LockfileStats (NPM v0.6.0)

Copy Markdown View Source

Computes statistics about the lockfile itself.

Summary

Functions

Computes lockfile metadata.

Computes lockfile content stats.

Estimates disk size of node_modules from lockfile.

Formats size in human-readable form.

Functions

compute(path)

@spec compute(String.t()) :: {:ok, map()} | {:error, term()}

Computes lockfile metadata.

content_stats(lockfile)

@spec content_stats(map()) :: map()

Computes lockfile content stats.

estimated_size(lockfile)

@spec estimated_size(map()) :: non_neg_integer()

Estimates disk size of node_modules from lockfile.

format_size(bytes)

@spec format_size(non_neg_integer()) :: String.t()

Formats size in human-readable form.