Skip to main content

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.

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:

Run with confignpx jsdoc -c jsdoc.json