NPM.IntegrityCheck (NPM v0.6.0)

Copy Markdown View Source

Verifies installed packages match lockfile entries.

Checks version, integrity, and presence of packages in node_modules.

Summary

Functions

Checks if all packages pass verification.

Formats verification results.

Groups verification failures by reason.

Verifies all lockfile packages are correctly installed.

Verifies a single package against its lockfile entry.

Functions

all_valid?(lockfile, node_modules \\ "node_modules")

@spec all_valid?(map(), String.t()) :: boolean()

Checks if all packages pass verification.

format_results(failures)

@spec format_results([map()]) :: String.t()

Formats verification results.

group_failures(failures)

@spec group_failures([map()]) :: map()

Groups verification failures by reason.

verify_all(lockfile, node_modules \\ "node_modules")

@spec verify_all(map(), String.t()) :: [map()]

Verifies all lockfile packages are correctly installed.

verify_package(name, entry, node_modules \\ "node_modules")

@spec verify_package(String.t(), map(), String.t()) :: :ok | {:error, atom()}

Verifies a single package against its lockfile entry.