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

OptionDefaultDescription
--root <path>.Project root directory
--tsconfig <path>auto-detectedPath to tsconfig.json
--pattern <glob>**/*.controller.tsGlob pattern to find controllers
--format <format>tsDocs file format to look for: ts or js
--min <percent>noneMinimum coverage required (0-100), exits 1 if below
--quietfalseSuppress 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 95

When 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 95

Or as an npm script:

json
{
  "scripts": {
    "docs:coverage": "nestjs-docfy coverage --min 95"
  }
}