diff --git a/doc/api/cli.md b/doc/api/cli.md index eeb7f25f4f82d9..b8276f6fd5e2d4 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -2604,6 +2604,43 @@ added: v0.8.0 Print stack traces for deprecations. +### `--trace-env` + + + +Print reads and writes to environment variables. + +The following accesses will be printed: + +* The environment variable reads that Node.js does internally. +* Writes in the form of `process.env.KEY = "SOME VALUE"`. +* Reads in the form of `process.env.KEY`. +* Definitions in the form of `Object.defineProperty(process.env, 'KEY', {...})`. +* Queries in the form of `Object.hasOwn(process.env, 'KEY')`, + `process.env.hasOwnProperty('KEY')` or `'KEY' in process.env`. +* Deletions in the form of `delete process.env.KEY`. + +To print the stack trace of the access, use `--trace-env-js-stack` and/or +`--trace-env-native-stack`. + +### `--trace-env-js-stack` + + + +In addition to what `--trace-env` does, this prints the JavaScript stack trace of the access. + +### `--trace-env-native-stack` + + + +In addition to what `--trace-env` does, this prints the native stack trace of the access. + ### `--trace-event-categories`