docfy coverage
Measures what percentage of your endpoints are documented. Useful as an objective quality metric and as a CI gate.
Usage
bash
npx nestjs-docfy coverage [options]Options
| Option | Default | Description |
|---|---|---|
--root <path> | . | Project root directory |
--tsconfig <path> | auto-detected | Path to tsconfig.json |
--pattern <glob> | **/*.controller.ts | Glob pattern to find controllers |
--format <format> | ts | Docs file format to look for: ts or js |
--min <percent> | none | Minimum coverage required (0-100), exits 1 if below |
--quiet | false | Suppress all output except errors |
Example output
text
Controllers: 42
Endpoints: 187
Documented: 174
Missing docs: 13
Coverage: 93.0%Enforcing a minimum in CI
bash
npx nestjs-docfy coverage --min 95When coverage falls below --min, the command exits with code 1, failing the build.
.github/workflows/*.yml
# GitHub Actions example
- name: Enforce documentation coverage
run: npx nestjs-docfy coverage --min 95Or as an npm script:
json
{
"scripts": {
"docs:coverage": "nestjs-docfy coverage --min 95"
}
}