Skip to content

Conversation

@levi42x
Copy link

@levi42x levi42x commented Nov 18, 2025

  • Added a new NpmrcHandler to enable parsing of .npmrc files.
  • This handler extracts key/value pairs (such as registry settings, authentication tokens, and init.* defaults) and stores them in extra_data on PackageData, making npm configuration discoverable through ScanCode outputs.

This PR includes the following updates:

  • Added NpmrcHandler in npm.py
  • Added corresponding unit tests in test_npmrc.py
  • Added .npmrc test fixture and its expected result file
  • Verified that the basic parsing functionality works as intended

Fixes #4494

Tasks

  • Reviewed contribution guidelines
  • PR is descriptively titled 📑 and links the original issue above 🔗
  • Tests pass locally ✔️
  • Commits are in a uniquely-named feature branch and contain no merge conflicts 📁
  • Updated documentation pages (if applicable)
  • Updated CHANGELOG.rst (can be added upon request)

Any feedback, suggestions, or requested changes are very welcome!

Signed-off-by: Shekhar Suman [email protected]

)

Add NpmrcHandler in src/packagedcode/npm.py to parse .npmrc configuration files
and yield a PackageData with parsed key/value pairs in extra_data. Add unit test
and fixtures under tests/packagedcode/data/npm/basic/.

Signed-off-by: Shekhar <[email protected]>
@levi42x levi42x changed the title Parse .npmrc files (Fix #4494) Parse .npmrc files Nov 18, 2025
@levi42x levi42x mentioned this pull request Nov 18, 2025
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.

Parse npmrc

1 participant