JSDoc is an API documentation generator for JavaScript that reads annotations in source comments and produces a browsable documentation site, aimed at JavaScript developers and library maintainers who need reference documentation to stay in sync with code.
What it is
JSDoc is a documentation toolchain for JavaScript, distributed as the npm package jsdoc and licensed under the Apache License, Version 2.0. It lives in the JavaScript and Node.js ecosystem, and the README states that it supports stable versions of Node.js 8.15.0 and later. The project is maintained under copyright of Michael Mathews and the contributors to JSDoc, with development carried out in the public jsdoc/jsdoc repository on GitHub, where it reports 15,463 stars, 1,492 forks, and 459 open issues. Documentation for the tool itself is published at jsdoc.app, and the docs site is maintained separately in the jsdoc/jsdoc.github.io repository.
The concrete problem it solves is the gap between source code and written API reference. Rather than maintaining a separate prose manual that drifts from the implementation, a developer annotates functions, classes, and modules directly in JavaScript files, and JSDoc parses those annotations to generate the reference output. That makes it a replacement for hand-written API documentation pages, and for ad hoc comment scraping, in projects that would otherwise have no generated reference at all. Running the command against a file such as yourJavaScriptFile.js produces a documentation directory, out by default, which can then be published or served.
Key capabilities
- Generates API documentation directly from annotated JavaScript source files, invoked as
jsdoc yourJavaScriptFile.js.
- Writes output to a directory named
out by default, relocatable with the --destination (-d) option.
- Exposes a complete command-line option list through
jsdoc --help.
- Installs either globally as
npm install -g jsdoc or locally as npm install --save-dev jsdoc into a project's node_modules folder.
- Provides a local executable at
./node_modules/.bin/jsdoc when installed as a project dependency.
- Supports a template ecosystem, including
jaguarjs-jsdoc, DocStrap, jsdoc3Template, minami, docdash, tui-jsdoc-template, and better-docs, which customize the generated output.
- Integrates with common build pipelines through the JSDoc Grunt plugin, the JSDoc Gulp plugin, and the JSDoc GitHub Action, and interoperates with
jsdoc-to-markdown for Markdown output.
Who uses it and how
- Application and library teams that keep reference documentation inside the source tree, running JSDoc as an npm dependency so every developer has the command available without a global install.
- Open-source library maintainers who publish generated reference documentation for their public API, using templates such as
DocStrap or docdash to match a project's site design.
- Teams with existing Node-based build systems that wire JSDoc into Grunt or Gulp tasks, or into continuous integration through the JSDoc GitHub Action, so documentation regenerates alongside the code.
- Documentation authors who need Markdown rather than HTML, using
jsdoc-to-markdown and, from the README's links, integrations such as GitBook.
- Contributors and users seeking support through the JSDoc Users mailing list or questions tagged
jsdoc on Stack Overflow.
Getting started
Install with npm install -g jsdoc for a global jsdoc command, or npm install --save-dev jsdoc for a project-local install that puts the tool at ./node_modules/.bin/jsdoc. Run it against a source file, for example jsdoc yourJavaScriptFile.js or ./node_modules/.bin/jsdoc yourJavaScriptFile.js, and read the generated pages from the default out directory or the path given to --destination.
How it compares
JSDoc sits at the base of a small ecosystem of templates and integrations rather than competing with them: minami, docdash, DocStrap, better-docs, and jaguarjs-jsdoc are alternative output templates built for JSDoc, while jsdoc-to-markdown converts its parsed output into another format. The Grunt, Gulp, and GitHub Action plugins place the same tool inside build systems rather than replacing it.
When to use it — and when not to
A team adopting JSDoc must operate a Node.js build step and maintain annotations in source, since the tool generates only what the comments describe; nothing in the README mentions a hosted service, database, or other runtime dependency, so the operational surface is small but real. The README is sparse: it documents installation and invocation, then defers feature detail to jsdoc.app and a mailing list, and the repository carries 459 open issues, so anyone wanting exhaustive in-repo guidance should check the published documentation site first. Projects that are not written in JavaScript, or that expect documentation generated from code structure without annotations, should look elsewhere.
project readme (upstream, from github) — read inline
JSDoc

An API documentation generator for JavaScript.
Want to contribute to JSDoc? Please read CONTRIBUTING.md.
Installation and Usage
JSDoc supports stable versions of Node.js 8.15.0 and later. You can install
JSDoc globally or in your project's node_modules folder.
To install the latest version on npm globally (might require sudo;
learn how to fix this):
npm install -g jsdoc
To install the latest version on npm locally and save it in your package's
package.json file:
npm install --save-dev jsdoc
Note: By default, npm adds your package using the caret operator in front of
the version number (for example, ^3.6.3). We recommend using the tilde
operator instead (for example, ~3.6.3), which limits updates to the most
recent patch-level version. See
this Stack Overflow answer for
more information about the caret and tilde operators.
If you installed JSDoc locally, the JSDoc command-line tool is available in
./node_modules/.bin. To generate documentation for the file
yourJavaScriptFile.js:
./node_modules/.bin/jsdoc yourJavaScriptFile.js
If you installed JSDoc globally, run the jsdoc command:
jsdoc yourJavaScriptFile.js
By default, the generated documentation is saved in a directory named out. You
can use the --destination (-d) option to specify another directory.
Run jsdoc --help for a complete list of command-line options.
Templates and tools
The JSDoc community has created templates and other tools to help you generate
and customize your documentation. Here are a few of them:
Templates
Build tools
Other tools
For more information
License
JSDoc is copyright (c) 2011-present Michael Mathews and
the contributors to JSDoc.
JSDoc is free software, licensed under the Apache License, Version 2.0. See the
LICENSE file for more details.