@@ -443,6 +443,48 @@ Affects the default output directory of:
443
443
* [ ` --heap-prof-dir ` ] [ ]
444
444
* [ ` --redirect-warnings ` ] [ ]
445
445
446
+ ### ` --disable-warnings=code-or-type `
447
+
448
+ <!-- YAML
449
+ added: REPLACEME
450
+ -->
451
+
452
+ Disable specific process warnings by ` code ` or ` type ` .
453
+
454
+ Warnings emitted from [ ` process.emitWarning() ` ] [ emit_warning ] may contain a
455
+ ` code ` and a ` type ` . This option will not-emit warnings that have a matching
456
+ ` code ` or ` type ` .
457
+
458
+ List of [ deprecation warnings] [ ] .
459
+
460
+ The Node.js core warning types are: ` DeprecationWarning ` and
461
+ ` ExperimentalWarning `
462
+
463
+ For example, the following script will not emit
464
+ [ DEP0025 ` require('node:sys') ` ] [ DEP0025 warning ] when executed with
465
+ ` node --disable-warnings=DEP0025 ` :
466
+
467
+ ``` js
468
+ ' use strict' ;
469
+
470
+ const sys = require (' sys' ); // eslint-disable-line no-restricted-modules
471
+ ```
472
+
473
+ For example, the following script will emit the
474
+ [ DEP0025 ` require('node:sys') ` ] [ DEP0025 warning ] , but not any Experimental
475
+ Warnings (such as
476
+ [ ExperimentalWarning: ` vm.measureMemory ` is an experimental feature] [ ]
477
+ in <=v21) when executed with ` node --disable-warnings=ExperimentalWarnings ` :
478
+
479
+ ``` js
480
+ ' use strict' ;
481
+
482
+ const sys = require (' sys' ); // eslint-disable-line no-restricted-modules
483
+ const vm = require (' vm' );
484
+
485
+ vm .measureMemory ();
486
+ ```
487
+
446
488
### ` --disable-proto=mode `
447
489
448
490
<!-- YAML
@@ -2126,6 +2168,14 @@ added: v0.1.3
2126
2168
2127
2169
Print node's version.
2128
2170
2171
+ ### ` --warnings `
2172
+
2173
+ <!-- YAML
2174
+ added: v6.0.0
2175
+ -->
2176
+
2177
+ Emit all process warnings (including deprecations). Enabled by default. See [ ` --no-warnings ` ] [ ] to disable all process warnings.
2178
+
2129
2179
### ` --watch `
2130
2180
2131
2181
<!-- YAML
@@ -2327,6 +2377,7 @@ Node.js options that are allowed are:
2327
2377
* ` --conditions ` , ` -C `
2328
2378
* ` --diagnostic-dir `
2329
2379
* ` --disable-proto `
2380
+ * ` --disable-warnings `
2330
2381
* ` --dns-result-order `
2331
2382
* ` --enable-fips `
2332
2383
* ` --enable-network-family-autoselection `
@@ -2429,6 +2480,7 @@ Node.js options that are allowed are:
2429
2480
* ` --use-largepages `
2430
2481
* ` --use-openssl-ca `
2431
2482
* ` --v8-pool-size `
2483
+ * ` --warnings `
2432
2484
* ` --watch-path `
2433
2485
* ` --watch-preserve-output `
2434
2486
* ` --watch `
@@ -2779,7 +2831,9 @@ done
2779
2831
[ CommonJS ] : modules.md
2780
2832
[ CommonJS module ] : modules.md
2781
2833
[ CustomEvent Web API ] : https://dom.spec.whatwg.org/#customevent
2834
+ [ DEP0025 warning ] : deprecations.md#DEP0025
2782
2835
[ ECMAScript module ] : esm.md#modules-ecmascript-modules
2836
+ [ ExperimentalWarning: `vm.measureMemory` is an experimental feature ] : vm.md#vmmeasurememoryoptions
2783
2837
[ Fetch API ] : https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
2784
2838
[ File System Permissions ] : permissions.md#file-system-permissions
2785
2839
[ Module customization hooks ] : module.md#customization-hooks
@@ -2808,6 +2862,7 @@ done
2808
2862
[ `--experimental-wasm-modules` ] : #--experimental-wasm-modules
2809
2863
[ `--heap-prof-dir` ] : #--heap-prof-dir
2810
2864
[ `--import` ] : #--importmodule
2865
+ [ `--no-warnings` ] : #--no-warnings
2811
2866
[ `--openssl-config` ] : #--openssl-configfile
2812
2867
[ `--preserve-symlinks` ] : #--preserve-symlinks
2813
2868
[ `--redirect-warnings` ] : #--redirect-warningsfile
@@ -2835,6 +2890,7 @@ done
2835
2890
[ context-aware ] : addons.md#context-aware-addons
2836
2891
[ debugger ] : debugger.md
2837
2892
[ debugging security implications ] : https://nodejs.org/en/docs/guides/debugging-getting-started/#security-implications
2893
+ [ deprecation warnings ] : deprecations.md#list-of-deprecated-apis
2838
2894
[ emit_warning ] : process.md#processemitwarningwarning-options
2839
2895
[ environment_variables ] : #environment-variables
2840
2896
[ filtering tests by name ] : test.md#filtering-tests-by-name
0 commit comments