Reads and analyzes npm's package-lock.json format.
Supports lockfileVersion 1, 2, and 3 for compatibility with projects migrating from npm.
Summary
Functions
Returns metadata about the lockfile.
Counts the total number of packages in the lockfile.
Extracts package names and versions.
Reads a package-lock.json file.
Checks if the lockfile requires npm 7+ (v2/v3 format).
Detects the lockfile version.
Functions
Returns metadata about the lockfile.
@spec package_count(map()) :: non_neg_integer()
Counts the total number of packages in the lockfile.
Extracts package names and versions.
Reads a package-lock.json file.
Checks if the lockfile requires npm 7+ (v2/v3 format).
@spec version(map()) :: 1 | 2 | 3 | nil
Detects the lockfile version.