diff --git a/doc/api/cli.md b/doc/api/cli.md index 5f29c497426db6..4a05b0e1d1c5d9 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -443,6 +443,32 @@ Affects the default output directory of: * [`--heap-prof-dir`][] * [`--redirect-warnings`][] +### `--disable-global=name` + + + +> Stability: 1.2 - Release candidate + +Remove specified global variables from the global scope. This flag can be used +multiple times to remove multiple variables. + +Not all global variables can be removed. The currently supported variables are: + + +- `CustomEvent` +- `fetch`; removing this also removes `FormData`, `Headers`, `Request`, and + `Response` +- `navigator` +- `WebSocket` + +```bash +node --disable-global=CustomEvent --disable-global=navigator \ + --eval 'console.log(typeof CustomEvent, typeof navigator)' +undefined undefined +``` + ### `--disable-proto=mode`