@@ -625,6 +625,32 @@ Path to the file used to store the persistent REPL history. The default path is
625625` ~/.node_repl_history ` , which is overridden by this variable. Setting the value
626626to an empty string (` '' ` or ` ' ' ` ) disables persistent REPL history.
627627
628+ ### ` NODE_V8_COVERAGE=dir `
629+
630+ When set, Node.js will begin outputting [ V8 JavaScript code coverage] [ ] to the
631+ directory provided as an argument. Coverage is output as an array of
632+ [ ScriptCoverage] [ ] objects:
633+
634+ ``` json
635+ {
636+ "result" : [
637+ {
638+ "scriptId" : " 67" ,
639+ "url" : " internal/tty.js" ,
640+ "functions" : []
641+ }
642+ ]
643+ }
644+ ```
645+
646+ ` NODE_V8_COVERAGE ` will automatically propagate to subprocesses, making it
647+ easier to instrument applications that call the ` child_process.spawn() ` family
648+ of functions. ` NODE_V8_COVERAGE ` can be set to an empty string, to prevent
649+ propagation.
650+
651+ At this time coverage is only collected in the main thread and will not be
652+ output for code executed by worker threads.
653+
628654### ` OPENSSL_CONF=file `
629655<!-- YAML
630656added: v6.11.0
@@ -691,6 +717,8 @@ greater than `4` (its current default value). For more information, see the
691717[ `process.setUncaughtExceptionCaptureCallback()` ] : process.html#process_process_setuncaughtexceptioncapturecallback_fn
692718[ Chrome DevTools Protocol ] : https://chromedevtools.github.io/devtools-protocol/
693719[ REPL ] : repl.html
720+ [ ScriptCoverage ] : https://chromedevtools.github.io/devtools-protocol/tot/Profiler#type-ScriptCoverage
721+ [ V8 JavaScript code coverage ] : https://v8project.blogspot.com/2017/12/javascript-code-coverage.html
694722[ debugger ] : debugger.html
695723[ emit_warning ] : process.html#process_process_emitwarning_warning_type_code_ctor
696724[ experimental ECMAScript Module ] : esm.html#esm_loader_hooks
0 commit comments