cli: implement --trace-env and --trace-env-[js|native]-stack#55604
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This implements
--trace-env,--trace-env-js-stackand--trace-env-native-stackCLI options that print information about any access to environment variables done in the current Node.js instance to stderr, including:process.env.KEY = "SOME VALUE".process.env.KEY.Object.defineProperty(process.env, 'KEY', {...}).Object.hasOwn(process.env, 'KEY'),process.env.hasOwnProperty('KEY')or'KEY' in process.env.delete process.env.KEY....process.envorObject.keys(process.env).Only the names of the environment variables being accessed are printed. The values are not printed. To print the stack trace of the access, use
--trace-env-js-stackand/or--trace-env-native-stack.See output of `--trace-env-js-stack`