esdoc vs jsdoc vs typedoc
Generating API Documentation for JavaScript and TypeScript Projects
esdocjsdoctypedocSimilar Packages:

Generating API Documentation for JavaScript and TypeScript Projects

jsdoc, typedoc, and esdoc are tools designed to generate documentation from source code comments. jsdoc is the long-standing standard for plain JavaScript, using JSDoc comments to describe types and behavior. typedoc is built specifically for TypeScript, leveraging the compiler's type system to produce accurate API references. esdoc focused on ES6 features and static analysis but has seen significantly less maintenance activity in recent years compared to the other two. All three output HTML documentation, but they differ in configuration, type inference, and ecosystem support.

Npm Package Weekly Downloads Trend

3 Years

Github Stars Ranking

Stat Detail

Package
Downloads
Stars
Size
Issues
Publish
License
esdoc02,729-1668 years agoMIT
jsdoc015,4641.47 MB460a year agoApache-2.0
typedoc08,4522.18 MB193 months agoApache-2.0

JSDoc vs TypeDoc vs ESDoc: Documentation Architecture Compared

All three tools aim to turn code comments into readable websites, but they handle types, configuration, and modern syntax very differently. jsdoc is the battle-tested standard for JavaScript. typedoc is the native choice for TypeScript. esdoc offered a unique approach to ES6 but has fallen behind in maintenance. Let's compare how they handle real-world documentation tasks.

⚙️ Configuration Setup: JSON vs TS Config

jsdoc uses a dedicated JSON configuration file.

  • You define source paths, templates, and plugins in jsdoc.conf.json.
  • It is straightforward but separate from your build config.
// jsdoc: jsdoc.conf.json
{
  "source": { "include": ["src"] },
  "opts": { "destination": "./docs" }
}

typedoc integrates with your TypeScript config.

  • It reads tsconfig.json by default, reducing duplicate setup.
  • You can add a typedoc.json for specific overrides.
// typedoc: typedoc.json
{
  "entryPoints": ["src/index.ts"],
  "out": "docs"
}

esdoc uses its own JSON config file.

  • Similar to JSDoc but with specific keys for ES6 features.
  • Configuration options are less frequently updated.
// esdoc: .esdoc.json
{
  "source": "./src",
  "destination": "./doc"
}

📝 Type Annotations: Comments vs Compiler Types

jsdoc relies entirely on comments for type information.

  • You must write @param and @returns tags manually.
  • Great for JS, but can drift from actual code if not maintained.
// jsdoc: Manual type comments
/**
 * @param {string} name - The user name
 * @returns {number} The user ID
 */
function getUser(name) { return 1; }

typedoc infers types from TypeScript code directly.

  • Comments are optional for types; the compiler provides them.
  • Reduces boilerplate and ensures accuracy.
// typedoc: TypeScript inference
function getUser(name: string): number {
  return 1;
}

esdoc uses JSDoc-style comments with ES6 focus.

  • Supports @interface and @typedef similar to JSDoc.
  • Parsing can be stricter on ES6 syntax than older JSDoc versions.
// esdoc: ES6 focused comments
/**
 * @interface User
 * @property {string} name
 */

📘 TypeScript Support: Native vs Transpiled

jsdoc supports TypeScript via type comments in JS files.

  • It does not understand .ts files natively without plugins.
  • Often requires stripping types before parsing.
// jsdoc: TS support via JSDoc in JS
/** @typedef {import('./types').User} User */

typedoc is built for TypeScript first.

  • Handles .ts and .tsx files out of the box.
  • Understands generics, unions, and advanced TS features.
// typedoc: Native TS generics
function wrap<T>(value: T): T {
  return value;
}

esdoc has limited TypeScript support.

  • Requires plugins to parse TypeScript syntax properly.
  • Often struggles with newer TS features compared to TypeDoc.
// esdoc: TS via plugin
// Requires esdoc-typescript-plugin in config

🎨 Output and Themes: Customization Levels

jsdoc offers many community templates.

  • You can swap themes via the template config option.
  • Popular options include minami and clean-jsdoc-theme.
// jsdoc: Setting a template
{
  "opts": { "template": "node_modules/minami" }
}

typedoc has a default theme with plugin options.

  • The default is clean and functional.
  • Plugins like typedoc-plugin-markdown allow non-HTML output.
// typedoc: Markdown plugin
{
  "plugin": ["typedoc-plugin-markdown"]
}

esdoc comes with a built-in modern theme.

  • The default look is distinct but harder to customize.
  • Fewer third-party themes are available due to lower adoption.
// esdoc: Theme config
{
  "theme": "esdoc-standard-theme"
}

🧩 Ecosystem and Plugins: Maturity Matters

jsdoc has the largest plugin library.

  • Decades of community contributions mean tools exist for almost any need.
  • Easy to find plugins for React, Vue, or custom tags.
// jsdoc: Using a plugin
{
  "plugins": ["plugins/markdown"]
}

typedoc has a growing, high-quality ecosystem.

  • Plugins focus on TypeScript-specific enhancements.
  • Active development ensures compatibility with new TS versions.
// typedoc: Reflection plugin
{
  "plugin": ["typedoc-plugin-external-module-name"]
}

esdoc has a stagnant plugin ecosystem.

  • Many plugins are unmaintained and may break with newer Node versions.
  • Risk of security or compatibility issues in long-term projects.
// esdoc: Plugin risk
// Many plugins haven't been updated in years

🌱 Similarities: Shared Ground

While they differ in focus, all three tools share core documentation goals.

1. 📄 Comment-Based Documentation

  • All use block comments /** ... */ to define docs.
  • Support standard tags like @description and @example.
// Common to all
/**
 * @description Calculates sum
 * @example sum(1, 2)
 */

2. 🌐 HTML Output

  • All generate static HTML sites by default.
  • Can be hosted on GitHub Pages, Netlify, or Vercel.
# Common command
npm run docs

3. 🔍 Search Functionality

  • Generated docs include search bars for navigating APIs.
  • Helps developers find classes and functions quickly.
<!-- All outputs include -->
<input type="text" id="search" />

📊 Summary: Key Differences

Featurejsdoctypedocesdoc
Primary LanguageJavaScriptTypeScriptJavaScript (ES6)
Type InferenceManual via commentsAutomatic via compilerManual via comments
Config Sourcejsdoc.conf.jsontsconfig.json / typedoc.json.esdoc.json
Maintenance✅ Active✅ Active⚠️ Low Activity
Plugin Ecosystem🟢 Large🟢 Growing🔴 Stagnant

💡 The Big Picture

jsdoc is the safe, universal choice 🛡️ for JavaScript libraries. It works everywhere, supports all editors, and has a plugin for everything. Use it when you want stability and broad compatibility.

typedoc is the precision tool 🎯 for TypeScript projects. It saves time by reading your types automatically and keeps docs in sync with code. Use it for any modern TS codebase.

esdoc is a legacy option 🕰️ that introduced nice ES6 features early but has since been overtaken. Unless you have a specific reason to stick with it, jsdoc or typedoc are better investments for long-term maintenance.

Final Thought: Documentation tools should reduce friction, not add it. For most teams today, typedoc (for TS) or jsdoc (for JS) provides the best balance of features, support, and future-proofing.

How to Choose: esdoc vs jsdoc vs typedoc

  • esdoc:

    Choose esdoc only if you are maintaining a legacy project that already depends on its specific static analysis features. For new projects, it is generally recommended to avoid it due to lower maintenance activity and slower adoption of modern JavaScript features compared to jsdoc and typedoc.

  • jsdoc:

    Choose jsdoc for pure JavaScript projects where broad IDE support and community stability are priorities. It is the industry standard for JSDoc comments, ensuring your annotations work seamlessly with VS Code and other editors. Its plugin ecosystem is mature, allowing for custom tags and output formats.

  • typedoc:

    Choose typedoc if your project is written in TypeScript or uses heavy JSDoc typing in JavaScript. It reads your tsconfig.json and understands complex types, interfaces, and generics without needing duplicate type definitions in comments. It is the best fit for modern type-safe codebases.

README for esdoc

Build Status Coverage Status Document

ESDoc

ESDoc is a documentation generator for JavaScript.
Please try it out!

Features

  • Generates good documentation.
  • Measures documentation coverage.
  • Integrate test codes into documentation.
  • Integrate manual into documentation.
  • Parse ECMAScript proposals.
  • ESDoc Hosting Service

Users

And more.

Quick Start

# Move to a your project directory.
cd your-project/

# Install ESDoc and standard plugin.
npm install --save-dev esdoc esdoc-standard-plugin

# Create a configuration file.
echo '{
  "source": "./src",
  "destination": "./docs",
  "plugins": [{"name": "esdoc-standard-plugin"}]
}' > .esdoc.json

# Run ESDoc.
./node_modules/.bin/esdoc

# View a documentation
open ./docs/index.html

Document

please visit esdoc.org to see more documentation.

License

MIT

Author

Ryo Maruyama@h13i32maru