File Format Requirements
Configuration files must be loadable via animport() call:
- JavaScript/ESM:
.mjsor.jswith"type": "module"in package.json - JSON:
.jsonfiles
Complete Configuration Example
- JavaScript
- JSON
Global Configuration
Theglobal object contains settings that apply to all generators unless overridden by generator-specific configuration.
| Property | Type | Description | Default |
|---|---|---|---|
version | string | SemVer | Documentation version | process.version |
minify | boolean | Whether to minify output | true |
repository | string | GitHub repository in owner/repo format | 'nodejs/node' |
ref | string | Git reference (branch, tag, or commit SHA) | 'HEAD' |
baseURL | string | URL | Base URL for documentation | 'https://nodejs.org/docs' |
input | string[] | Input directory path or glob patterns | - |
output | string | Output directory path | - |
ignore | string[] | Glob patterns to ignore | [] |
changelog | string | URL | Changelog URL or file path | Auto-generated URL based on ref and repository |
index | string | URL | Index file URL or path | - |
Version
Specifies the target Node.js version for documentation generation. Accepts semver strings which are automatically coerced:Repository and Ref
Define the GitHub repository and git reference for source code linking:Input and Output
Control where doc-kit reads source files and writes generated documentation:Changelog and Index
Provide URLs or file paths to changelog and index files:changelog is auto-generated based on repository and ref:
Top-Level Configuration
threads
Number of worker threads to use for parallel processing:chunkSize
Number of items to process per worker thread:target
Array of generator names to run:Generator-Specific Configuration
Each generator can have its own configuration that inherits fromglobal and allows overrides:
How Overrides Work
Generator-specific configuration:- Inherits all properties from
global - Can override any global property
- Can add generator-specific properties
- JavaScript
- JSON
Configuration Transformation
Some configuration values are automatically transformed:- version: String values are coerced to SemVer objects
- changelog: URLs are fetched and parsed into release entries
- index: URLs are fetched and parsed into index entries
Type Map Configuration
Themetadata generator supports a typeMap property for mapping type names:
Minimal Configuration
The minimum required configuration only needsinput and output:
- JavaScript
- JSON