{"id":12222,"library":"typedoc","title":"TypeDoc","description":"TypeDoc is a powerful and flexible documentation generator designed specifically for TypeScript projects. It parses TypeScript source code and leverages the TypeScript compiler's API to extract type information, comments, and structure, transforming it into detailed API documentation, typically in HTML format. The current stable version is 0.28.19, and the project maintains an active release cadence, frequently delivering updates with new features, bug fixes, and support for the latest TypeScript versions. Its key differentiators include deep integration with the TypeScript ecosystem, robust support for monorepos and merging documentation from multiple packages, and extensive customization options through themes and configuration files. TypeDoc can automatically discover `tsconfig.json` and entry points, simplifying initial setup, while also providing fine-grained control over the generation process via command-line arguments and programmatic API.","status":"active","version":"0.28.19","language":"javascript","source_language":"en","source_url":"git://github.com/TypeStrong/TypeDoc","tags":["javascript","typescript","documentation","generator"],"install":[{"cmd":"npm install typedoc","lang":"bash","label":"npm"},{"cmd":"yarn add typedoc","lang":"bash","label":"yarn"},{"cmd":"pnpm add typedoc","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"TypeDoc relies directly on the TypeScript compiler API for parsing and type analysis. A compatible version is required as a peer dependency.","package":"typescript","optional":false}],"imports":[{"note":"TypeDoc is primarily a command-line interface (CLI) tool. The `typedoc` executable is the main entry point for most users, typically invoked via `npx` or a `package.json` script.","wrong":"import { typedoc } from 'typedoc'","symbol":"typedoc","correct":"npx typedoc [options]"},{"note":"Used for programmatic documentation generation within a Node.js application, allowing for custom workflows and integrations with build systems. This requires manual setup of options.","symbol":"Application","correct":"import { Application } from 'typedoc'"},{"note":"A utility class for the programmatic API (`Application`) to automatically load TypeDoc options from a `tsconfig.json` file, mimicking CLI behavior.","symbol":"TSConfigReader","correct":"import { TSConfigReader } from 'typedoc'"}],"quickstart":{"code":"{\n  \"name\": \"my-app\",\n  \"version\": \"1.0.0\",\n  \"description\": \"My example application.\",\n  \"devDependencies\": {\n    \"typedoc\": \"^0.28.0\",\n    \"typescript\": \"^5.0.0\"\n  },\n  \"scripts\": {\n    \"docs\": \"typedoc --out docs --entryPoints src --name \\\"My App API Docs\\\" --tsconfig tsconfig.json\"\n  }\n}\n\n// tsconfig.json\n{\n  \"compilerOptions\": {\n    \"target\": \"ES2020\",\n    \"module\": \"commonjs\",\n    \"strict\": true,\n    \"esModuleInterop\": true,\n    \"skipLibCheck\": true,\n    \"forceConsistentCasingInFileNames\": true,\n    \"outDir\": \"./dist\"\n  },\n  \"include\": [\"src/**/*.ts\"]\n}\n\n// src/index.ts\n/**\n * Represents a product available in the store.\n */\nexport interface Product {\n  /** The unique identifier of the product. */\n  id: string;\n  /** The name of the product. */\n  name: string;\n  /** The price of the product in USD. */\n  price: number;\n  /** A brief description of the product. */\n  description?: string;\n}\n\n/**\n * Fetches a list of all available products.\n * @returns An array of `Product` objects.\n */\nexport function getProducts(): Product[] {\n  return [\n    { id: 'prod1', name: 'Laptop', price: 1200, description: 'High-performance laptop.' },\n    { id: 'prod2', name: 'Mouse', price: 25 }\n  ];\n}\n\n// To run:\n// 1. Create the above package.json, tsconfig.json, and src/index.ts files in your project root.\n// 2. Open your terminal and navigate to the project root.\n// 3. Run: `npm install`\n// 4. Run: `npm run docs`\n// This will generate HTML documentation in the 'docs' directory.\n","lang":"typescript","description":"Demonstrates how to install TypeDoc, configure a basic TypeScript project, and generate API documentation using a package script with command-line options."},"warnings":[{"fix":"Upgrade your Node.js environment to version 18 or newer using tools like `nvm` or by installing a recent Node.js LTS version.","message":"TypeDoc requires Node.js version 18 or greater. Attempting to run TypeDoc with older Node.js versions will result in an error and prevent documentation generation.","severity":"breaking","affected_versions":">=0.28.0"},{"fix":"Ensure your project's `typescript` version matches one of the ranges specified in TypeDoc's `peerDependencies` (e.g., `^5.0.0`, `^5.4.0`). Update your `typescript` package if necessary.","message":"TypeDoc has a specific peer dependency on `typescript` versions. Using an incompatible TypeScript version in your project (outside the `5.0.x` through `6.0.x` range for TypeDoc 0.28.x) can lead to parsing errors, incorrect type resolution, or unexpected documentation output.","severity":"gotcha","affected_versions":">=0.28.0"},{"fix":"Review your `basePath` usage; if internal links are resolving unexpectedly after upgrading, consider if `displayBasePath` is the more appropriate option for your use case.","message":"The `basePath` option (introduced prior to 0.28.13) was updated in version 0.28.13 to affect relative link resolution within the generated documentation. If you only intend to change the rendered base path for source links without altering link resolution, use the `displayBasePath` option instead.","severity":"gotcha","affected_versions":">=0.28.13"},{"fix":"Explicitly define entry points using `--entryPoints <path/to/files>` or configure `entryPointStrategy` (e.g., `packages`, `expand`) in your TypeDoc configuration or CLI arguments, especially for complex project structures.","message":"For monorepos or projects with multiple distinct entry points, TypeDoc's automatic entry point discovery might be insufficient. Incorrect `entryPointStrategy` or missing explicit `--entryPoints` can lead to 'No entry points found' errors or incomplete documentation.","severity":"gotcha","affected_versions":">=0.20.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Upgrade your Node.js environment to version 18 or newer. Use `node -v` to check your current version and `nvm install 18 && nvm use 18` or similar tools to manage Node.js versions.","cause":"The current Node.js version running TypeDoc is older than the minimum required version 18.","error":"Error: TypeDoc requires Node.js version >= 18."},{"fix":"Ensure a `tsconfig.json` file exists in your project root or specify its exact path using the `--tsconfig <path/to/tsconfig.json>` option.","cause":"TypeDoc attempts to locate a `tsconfig.json` file in the current directory or specified path, but failed to find it.","error":"Error: Could not find tsconfig.json"},{"fix":"Specify the files or directories to document using `--entryPoints <path/to/files>` (e.g., `src/index.ts`) or configure `entryPointStrategy` in your TypeDoc options (e.g., `typedoc --entryPointStrategy packages`).","cause":"TypeDoc was unable to automatically determine which TypeScript files to process for documentation generation, often due to an empty `include` array in `tsconfig.json` or an incorrect `entryPointStrategy` for multi-package projects.","error":"Error: No entry points found. Ensure that your tsconfig.json specifies the files to include, or add an 'entryPointStrategy' option."},{"fix":"Check that your project's `typescript` peer dependency aligns with TypeDoc's requirements. Try deleting `node_modules` and `package-lock.json` (or `pnpm-lock.yaml`), then reinstalling dependencies with `npm install` or `pnpm install`.","cause":"This often indicates an incompatibility between the installed `typescript` package version and the `typedoc` package version, or a corrupted `node_modules` installation.","error":"TypeError: Cannot read properties of undefined (reading 'getSymbolAtLocation') [or similar internal TypeScript API errors]"}],"ecosystem":"npm"}