nyc – npm

By default, nyc only collects coverage for source files that are visited during a test. It does this by watching for files that are require()’d during the test. When a file is require()’d, nyc creates and returns an instrumented version of the source, rather than the original. Only source files that are visited during a test will appear in the coverage report and contribute to coverage statistics.

https://www.npmjs.com/package/nyc