Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(nodejs): add dependency line numbers for npm lock files #2932

Merged
merged 8 commits into from
Oct 12, 2022

Conversation

DmitriyLewen
Copy link
Contributor

@DmitriyLewen DmitriyLewen commented Sep 22, 2022

Description

Add dependency line numbers for npm lock files

e.g.:
package-lick.json file:

{
  "name": "intern-angular",
  "version": "1.0.0",
  "lockfileVersion": 1,
  "dependencies": {
    "@angular/animations": {
      "version": "4.2.6",
      "resolved": "[https://registry.npmjs.org/@angular/animations/-/animations-4.2.6.tgz"](https://registry.npmjs.org/@angular/animations/-/animations-4.2.6.tgz%22),
      "integrity": "sha1-nZyAoRmwwDaTy9I7uvcosVMf/8c="
    }
}

Trivy json result(with --list-all-pkgs flag):

➜ ./trivy fs -f json --list-all-pkgs ./package-lock.json
...
  "Results": [
    {
      "Target": "package-lock.json",
      "Class": "lang-pkgs",
      "Type": "npm",
      "Packages": [
        {
          "ID": "@angular/animations@4.2.6",
          "Name": "@angular/animations",
          "Version": "4.2.6",
          "Indirect": true,
          "Layer": {},
          "Locations": [
            {
              "StartLine": 6,
              "EndLine": 10
            }
          ]
        }
      ]
...

Related PRs

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've followed the conventions in the PR title.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

@DmitriyLewen DmitriyLewen self-assigned this Sep 23, 2022
@DmitriyLewen DmitriyLewen marked this pull request as ready for review October 12, 2022 04:46
@knqyf263 knqyf263 merged commit ca434f7 into main Oct 12, 2022
@knqyf263 knqyf263 deleted the feat/npm-deps-location branch October 12, 2022 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants