documentation, esdoc, jsdoc, and typedoc are tools that turn code comments into readable websites or static files. They help teams understand how to use libraries without reading source code. jsdoc is the oldest and works with plain JavaScript. typedoc is built specifically for TypeScript and reads type definitions directly. documentation focuses on modern JavaScript and Flow types with a clean output. esdoc was popular for ES6 but is now largely inactive. Choosing the right one depends on your language (JS vs TS) and how much automation you want.
Building maintainable libraries requires clear documentation. The tools documentation, esdoc, jsdoc, and typedoc all parse source code to create reference sites, but they handle languages and configuration very differently. Let's compare how they work in real engineering scenarios.
documentation works best with JavaScript and Flow types.
# documentation: Build from JS files
npx documentation build src/**/*.js -f html -o docs
esdoc was designed for ES6 JavaScript.
// esdoc: esdoc.json config
{
"source": "./src",
"destination": "./docs"
}
jsdoc is the standard for plain JavaScript.
// jsdoc: jsdoc.conf.json
{
"source": {
"include": ["src"],
"includePattern": ".+\\.js(doc|x)?$"
}
}
typedoc is built for TypeScript first.
tsconfig.json and understands interfaces, enums, and generics..ts files.// typedoc: typedoc.json
{
"entryPoints": ["src/index.ts"],
"out": "docs"
}
documentation uses CLI flags or a simple config file.
// documentation: .documentation.yml
project: My Library
version: 1.0.0
esdoc requires a JSON config file.
// esdoc: esdoc.json
{
"plugins": [{"name": "esdoc-coverage-plugin"}]
}
jsdoc uses a verbose JSON config.
// jsdoc: jsdoc.conf.json
{
"templates": {
"cleverLinks": true,
"monospaceLinks": true
}
}
typedoc integrates with TypeScript config.
tsconfig.json.# typedoc: CLI with tsconfig
npx typedoc --options tsconfig.json
documentation uses standard JSDoc tags.
@param, @returns, and @example.// documentation: JSDoc comment
/**
* Adds two numbers.
* @param {number} a - First number
* @returns {number} Sum of a and b
*/
function add(a, b) { return a + b; }
esdoc uses JSDoc with some extensions.
@typedef and @class heavily.// esdoc: JSDoc comment
/**
* @class
*/
class User {
/**
* @type {string}
*/
name = '';
}
jsdoc relies strictly on JSDoc tags.
// jsdoc: Verbose JSDoc
/**
* @module math
*/
/**
* @function add
* @param {number} a
* @param {number} b
* @returns {number}
*/
export function add(a, b) { return a + b; }
typedoc supports TSDoc and JSDoc.
@param and @returns but reads signatures from TS.// typedoc: TSDoc with inference
/**
* Adds two numbers.
* @param a - First number
* @param b - Second number
*/
export function add(a: number, b: number): number {
return a + b;
}
documentation is actively maintained.
# documentation: Check version
npx documentation --version
esdoc is no longer actively maintained.
# esdoc: Warning
# No active maintenance schedule
jsdoc is stable and mature.
# jsdoc: Stable release cycle
npx jsdoc --version
typedoc is very active.
# typedoc: Frequent updates
npx typedoc --version
| Feature | documentation | esdoc | jsdoc | typedoc |
|---|---|---|---|---|
| Primary Language | JavaScript / Flow | ES6 JavaScript | JavaScript | TypeScript |
| Type Inference | Limited (Flow) | Minimal | None (Manual) | Full (TS) |
| Config Complexity | Low | Medium | High | Low (with TS) |
| Maintenance | Active | Inactive | Stable | Active |
| Best For | JS Libraries | Legacy ES6 | Large JS Apps | TS Libraries |
documentation is like a lightweight editor βοΈ β great for JavaScript projects that need clean docs without heavy setup. Ideal for open-source JS libraries.
esdoc is like an old map πΊοΈ β it shows the way but is outdated. Avoid for new work; it does not handle modern type systems well.
jsdoc is like a sturdy filing cabinet ποΈ β reliable and holds everything, but you must organize it manually. Best for established JavaScript codebases.
typedoc is like a smart assistant π€ β it reads your code and writes the docs for you based on types. The clear winner for TypeScript projects.
Final Thought: If you are using TypeScript, use typedoc. If you are using plain JavaScript, documentation offers a better developer experience than jsdoc for most cases, while jsdoc remains the safe choice for legacy compatibility. Avoid esdoc for new development.
Choose documentation if you write modern JavaScript or Flow and want a fast setup with good Markdown support. It handles JSDoc comments well but shines when you want a simpler config than JSDoc. It is a strong pick for libraries that prioritize ease of use over deep TypeScript integration.
Do not choose esdoc for new projects. It is no longer actively maintained and lacks support for modern TypeScript features. Only use if maintaining a legacy system that already depends on it, and plan to migrate away soon.
Choose jsdoc if you need maximum stability and a huge plugin ecosystem for plain JavaScript. It is the industry standard for JSDoc comments but requires more configuration to look modern. It works best for large, established JavaScript codebases.
Choose typedoc if your project is written in TypeScript. It automatically picks up types from your code, reducing the need for repetitive comments, and keeps docs in sync with your type definitions. It is the default choice for modern TypeScript libraries.
The documentation system for modern JavaScript
:date: Current maintenance status
Globally install documentation using the npm package manager:
$ npm install -g documentation
This installs a command called documentation in your path, that you can
point at JSDoc-annotated source code to generate
human-readable documentation. First, run documentation with the --help
option for help:
Usage:
# generate markdown docs for index.js and files it references
documentation build index.js -f md
# generate html docs for all files in src, and include links to source files in github
documentation build src/** -f html --github -o docs
# document index.js, ignoring any files it requires or imports
documentation build index.js -f md --shallow
# validate JSDoc syntax in util.js
documentation lint util.js
# update the API section of README.md with docs from index.js
documentation readme index.js --section=API
# build docs for all values exported by index.js
documentation build --document-exported index.js
# build html docs for a TypeScript project
documentation build index.ts --parse-extension ts -f html -o docs
Commands:
build [input..] build documentation
lint [input..] check for common style and uniformity mistakes
readme [input..] inject documentation into your README.md
Options:
--version Show version number [boolean]
--help Show help [boolean]
We have plenty of issues that we'd love help with.
JSDoc support, including typedefs.documentation is an OPEN Open Source Project. This means that:
Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is more like an open wiki than a standard guarded open source project.