Skip to content

Implement npm lock file v2 support

Fabien Catteau requested to merge npm-lockfile-v2 into master

What does this MR do?

Implement npm lockfile v2 support

When parsing lockfile v2, package information is extracted from the new packages JSON field. The keys packages (map) are the paths to the packages, like x/node_modules/y/node_modules/z. The parser extracts the local path, like z in this case. packages contains all package versions, so there's no recursion in the case of lockfile v2.

fixtures/big-lockfile-v2 was created by converting fixtures/big to lock file version v2, using npm 7. The packages returned by the parser are exactly the same.

What are the relevant issue numbers?

gitlab-org/gitlab#273651 (closed)

Does this MR meet the acceptance criteria?

Edited by Fabien Catteau

Merge request reports

Loading