docs(scripts): update npm_package_* environment variables documentation#8821
Conversation
owlstronaut
left a comment
There was a problem hiding this comment.
Are you open to documenting the install-specific envars that aren't currently documented anywhere?
cli/workspaces/arborist/lib/arborist/rebuild.js
Lines 310 to 316 in aa1dd7e
Also, i don't think main is actually included. I'm not sure if that was missed last time this was updated or why, but it isn't here and in my local tests I'm not seeing a value.
2329a66 to
09455b7
Compare
|
Thank you for the review! I've updated the documentation based on your feedback: Changes Made
These are sourced from The updated documentation now accurately reflects what environment variables are actually available to scripts. |
Description
This PR updates the npm_package_* environment variables documentation to reflect the changes made in npm 7.
Changes
npm_package_jsonprovides the path to package.json for scripts that need to read other fieldsContext
In npm 7, the behavior changed from providing all package.json fields as environment variables to only providing a specific subset. This was documented in RFC 21. The old documentation was misleading as it suggested all fields were still available.
Fixes
Fixes #2452