Skip to main content

Configuration File

Format

JSDoc accepts a JSON file (jsdoc.json or .jsdocrc) passed via --configure / -c:

Run with your config filenpx jsdoc -c jsdoc.json

The file contains a JSON object with top-level keys for each configuration domain.

Top-level keys

source

Controls which files JSDoc processes.

{
"source": {
"include": ["src", "lib"],
"exclude": ["src/vendor"],
"includePattern": ".+\\.js$",
"excludePattern": "(^|\\/|\\\\)_"
}
}
KeyTypeDescription
includestring[]Paths to files or directories to include.
excludestring[]Paths to exclude from processing.
includePatternstringRegex — only files matching this pattern are processed.
excludePatternstringRegex — files matching this pattern are excluded.

opts

Mirrors the command-line flags.

{
"opts": {
"destination": "docs",
"recurse": true,
"readme": "README.md",
"package": "./package.json",
"template": "jsdoc-template",
"tutorials": "tutorials",
"encoding": "utf8",
"access": "public",
"private": false,
"pedantic": false,
"verbose": false
}
}

plugins

An array of plugin paths or module names to load:

{
"plugins": [
"plugins/markdown"
]
}

tags

Tag parser settings.

{
"tags": {
"allowUnknownTags": true,
"dictionaries": ["jsdoc", "closure"]
}
}
KeyTypeDefaultDescription
allowUnknownTagsbooleantrueAllow tags not in the configured dictionaries.
dictionariesstring[]["jsdoc","closure"]Tag dictionaries to use.

templates

Settings passed to the documentation template.

{
"templates": {
"cleverLinks": false,
"monospaceLinks": false
}
}

Complete example

{
"source": {
"include": ["src"],
"includePattern": ".+\\.js$",
"excludePattern": "(^|\\/|\\\\)_"
},
"opts": {
"destination": "docs",
"recurse": true,
"readme": "README.md"
},
"plugins": ["plugins/markdown"],
"tags": {
"allowUnknownTags": true,
"dictionaries": ["jsdoc"]
},
"templates": {
"cleverLinks": true
}
}

See also