Configuration
JSDoc provides two configuration mechanisms that can be used together: command-line flags and a JSON configuration file. The configuration file is recommended for anything beyond simple one-off commands.
All CLI flags, from -r (recurse) to --verbose and --debug.
The full jsdoc.json schema โ source, opts, plugins, tags, and templates.
Configure the built-in HTML template: layout, analytics, colour, and more.
Precedenceโ
Command-line flags take precedence over values in the configuration file. Options set in the configuration file's opts block behave as defaults and are overridden by any equivalent CLI flag.
Minimal exampleโ
A minimal jsdoc.json that recursively processes a src/ folder and writes output to docs/:
{
"source": {
"include": ["src"],
"includePattern": ".+\\.js$"
},
"opts": {
"recurse": true,
"destination": "docs"
}
}
Run it with:
npx jsdoc -c jsdoc.jsonOfficial reference: jsdoc.app/about-configuring-jsdoc