> For the complete documentation index, see [llms.txt](https://docs.sealights.io/knowledgebase/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/node.js-agent/advanced-features/lightweight-v8-coverage-mode/configuration.md).

# Configuration

[Lightweight V8 Coverage Mode](https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/node.js-agent/advanced-features/lightweight-v8-coverage-mode.md) uses the regular `slnodejs` settings (token, build session ID, lab ID, project root, proxy), passed as flags of `slnodejs run` / `slnodejs mocha` or as preload script variables. See the [Command Reference](https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/node.js-agent/command-reference.md) and [Configuration](https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/node.js-agent/configuration.md).

The settings below are specific to this mode or behave differently in it. They have no flag: set them as environment variables of the `slnodejs` command or of the process started with the preload script. Names are case-sensitive.

## Settings <a href="#lightweight-mode-settings" id="lightweight-mode-settings"></a>

| Variable                            | Default                                    | Effect                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ----------------------------------- | ------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `SL_useLeanCoverageListener`        | off                                        | `true` turns this mode on for `slnodejs run`, `slnodejs mocha` and the preload script.                                                                                                                                                                                                                                                                                                                                                                          |
| `NODE_V8_COVERAGE`                  | `.sl-cov` in the working directory         | Folder where Node.js writes coverage files. Set it to use another folder, for example a writable volume in a read-only container. The folder is created when it does not exist.                                                                                                                                                                                                                                                                                 |
| `SL_COVERAGE_INTERVAL`              | `10000`                                    | Milliseconds between two coverage writes of your program. `0` or a value that is not a number means the default.                                                                                                                                                                                                                                                                                                                                                |
| `SL_footprintsSendIntervalSecs`     | `10`                                       | Seconds between two sends of the coverage the listener has read.                                                                                                                                                                                                                                                                                                                                                                                                |
| `SL_footprintsQueueSize`            | `2`                                        | Number of coverage files with hits that triggers a send before `SL_footprintsSendIntervalSecs` elapses.                                                                                                                                                                                                                                                                                                                                                         |
| `SL_enableChildProcessPatcher`      | not set                                    | Not set: your program writes coverage every interval; its child processes write only when they exit. `true`: child processes also write every interval. `false`: neither writes at the interval; do not use it in this mode. See [Child processes](https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/node.js-agent/advanced-features/lightweight-v8-coverage-mode/how-to-use.md#child-processes-and-worker-threads). |
| `SL_projectRoot` / `--projectRoot`  | working directory                          | Root that file paths are resolved against. Files outside it are not reported. See [TypeScript and compiled output](https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/node.js-agent/advanced-features/lightweight-v8-coverage-mode/how-to-use.md#typescript).                                                                                                                                                         |
| `SL_EXECUTION_CONTEXT_FILE`         | `sl-execution.json` in the coverage folder | `slnodejs mocha` only: the file through which the Mocha reporter tells the listener which test stage is running. Change it only if the coverage folder is not writable.                                                                                                                                                                                                                                                                                         |
| `SL_IN_PROCESS_COVERAGE_COLLECTION` |                                            | No effect with `slnodejs run`, `slnodejs mocha` or the preload script.                                                                                                                                                                                                                                                                                                                                                                                          |
| `SL_footprintsCollectIntervalSecs`  |                                            | No effect in this mode; `SL_COVERAGE_INTERVAL` sets the collection interval.                                                                                                                                                                                                                                                                                                                                                                                    |

Files in the `node_modules` folder of the project root, and files matched by a `.slignore` file in the working directory, are not reported.

{% hint style="warning" %}
The agent does not delete the files in the coverage folder. Make sure the folder is writable and has enough free space, and clean it between runs on long-lived environments. Other Node.js processes started with the same `NODE_V8_COVERAGE` also write to it.
{% endhint %}

## Logging <a href="#logging" id="logging"></a>

Logging works as for the rest of `slnodejs`: `NODE_DEBUG=sl` (console) or `sl-file` (file), and `SL_LOG_LEVEL`. See [Troubleshooting → Turn on logs](https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/node.js-agent/troubleshooting.md#turn-on-logs).

With `SL_LOG_LEVEL=debug`, the listener also writes a copy of every coverage batch it processes to a `.sl-cov-tmp` folder in the working directory. Attach it when you contact SeaLights support, then turn debug logging off: the folder grows with every batch.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/node.js-agent/advanced-features/lightweight-v8-coverage-mode/configuration.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
