JSDoc reads annotated JavaScript and writes HTML API documentation. It runs as a command-line tool on supported Node.js versions and can be installed globally or per project.
Overview
JSDoc is a tool that scans JavaScript source files for documentation comments and produces browsable API reference output. You point the jsdoc command at one or more files; by default it writes results into an out directory, and you can choose another destination with command-line flags.
The comment system covers many block and inline tags for functions, classes, modules, parameters, return values, deprecation, examples, and related metadata. Guidance covers namepaths, configuration files, default template options, plugins, Markdown integration, tutorials, included package documentation, and patterns for ES modules, CommonJS, and AMD.
The wider community maintains alternate templates and build-tool integrations; examples of those resources are cataloged alongside the main tool. Help is available through documentation, a documentation site, mailing lists, and tagged questions on Stack Overflow.
JSDoc requires a supported Node.js runtime and installs through npm either globally or as a dev dependency in a package, with the binary available under node_modules when installed locally.
Key features
- CLI documentation generation
- Rich block and inline tags
- Configurable output directory
- Config file support
- Default HTML template
- Plugin ecosystem
- Markdown plugin option
- Tutorials and README inclusion
Use cases
- Publishing JavaScript API references
- Keeping library docs in sync with code
- Documenting ES module or Node packages
- Adding examples via @example tags
- Custom templates for doc sites