typedoc vs @microsoft/api-extractor vs tsd vs dts-generator
TypeScript Documentation and Type Definitions Comparison
1 Year
typedoc@microsoft/api-extractortsddts-generatorSimilar Packages:
What's TypeScript Documentation and Type Definitions?

These packages are essential tools for managing TypeScript definitions and generating documentation. They help developers maintain type safety and provide clear, structured documentation for TypeScript projects. Each package has its unique focus, from extracting API information to generating comprehensive documentation, making them valuable in different scenarios of TypeScript development.

Package Weekly Downloads Trend
Github Stars Ranking
Stat Detail
Package
Downloads
Stars
Size
Issues
Publish
License
typedoc3,515,1838,1052.1 MB7a month agoApache-2.0
@microsoft/api-extractor2,518,4466,2102.01 MB943a month agoMIT
tsd889,3632,46894.9 kB522 months agoMIT
dts-generator14,770521-416 years agoBSD-3-Clause
Feature Comparison: typedoc vs @microsoft/api-extractor vs tsd vs dts-generator

Purpose

  • typedoc:

    typedoc is a documentation generator specifically for TypeScript projects. It parses the TypeScript source code and generates HTML documentation, allowing developers to create user-friendly guides that reflect the structure and types of their code.

  • @microsoft/api-extractor:

    @microsoft/api-extractor is designed to analyze TypeScript projects and extract API information, generating declaration files (.d.ts) that can be published alongside libraries. It ensures that the API surface is well-defined and consistent, making it easier for consumers to use the library.

  • tsd:

    tsd serves as a package manager for TypeScript definition files, allowing developers to easily install and manage type definitions for JavaScript libraries. It simplifies the process of integrating third-party libraries into TypeScript projects by providing a straightforward way to access type definitions.

  • dts-generator:

    dts-generator focuses on generating TypeScript declaration files from existing JavaScript codebases. It scans the JavaScript files and creates corresponding .d.ts files, allowing TypeScript users to benefit from type safety without requiring a complete rewrite of the codebase.

Output Quality

  • typedoc:

    typedoc generates high-quality documentation that is directly tied to the TypeScript source code. It produces well-structured HTML documentation that includes type information, making it easy for users to navigate and understand the API.

  • @microsoft/api-extractor:

    The output quality of @microsoft/api-extractor is high, as it ensures that the generated declaration files are accurate and well-structured. It also provides tools for validating the API surface, ensuring that any changes in the codebase are reflected in the documentation and type definitions.

  • tsd:

    The output quality of tsd is dependent on the availability of type definitions in the DefinitelyTyped repository. It provides a convenient way to access community-maintained definitions, but the quality may vary based on the contributions from the community.

  • dts-generator:

    dts-generator produces declaration files that are functional but may require additional manual adjustments for complex scenarios. While it automates the generation process, the quality of the output can vary based on the complexity of the original JavaScript code.

Ease of Use

  • typedoc:

    typedoc is easy to use for TypeScript projects, requiring minimal configuration to generate documentation. It integrates well with TypeScript's existing structure, making it accessible for developers familiar with TypeScript.

  • @microsoft/api-extractor:

    @microsoft/api-extractor requires some initial setup and configuration but provides comprehensive features for managing API surface and documentation. Once set up, it offers a streamlined process for maintaining type definitions and documentation as the project evolves.

  • tsd:

    tsd is user-friendly and straightforward, allowing developers to quickly install and manage type definitions with simple commands. It is ideal for those who want to integrate third-party libraries without delving into complex configurations.

  • dts-generator:

    dts-generator is relatively easy to use, requiring minimal configuration to start generating declaration files. It is suitable for developers who want a quick solution without extensive setup, although it may require some manual adjustments for optimal results.

Customization

  • typedoc:

    typedoc allows for significant customization of the generated documentation, including themes, templates, and included/excluded files. This flexibility enables developers to create documentation that aligns with their project's branding and structure.

  • @microsoft/api-extractor:

    @microsoft/api-extractor offers extensive customization options for generating declaration files and documentation. Developers can configure various aspects of the output, including file structure, comments, and API validation rules, allowing for tailored results that meet specific project needs.

  • tsd:

    tsd has basic customization capabilities, allowing developers to specify which type definitions to install. However, it relies on the community for the quality and structure of the definitions, limiting the extent of customization available.

  • dts-generator:

    dts-generator provides limited customization options, focusing primarily on generating declaration files from existing code. While it can handle basic scenarios, developers may need to manually edit the output for more complex requirements.

Community Support

  • typedoc:

    typedoc has a growing community of users and contributors, with active development and support. The documentation is well-maintained, and users can find various resources and examples to help them get started.

  • @microsoft/api-extractor:

    @microsoft/api-extractor is backed by Microsoft, ensuring strong community support and regular updates. The documentation is comprehensive, and there are numerous resources available for troubleshooting and best practices.

  • tsd:

    tsd benefits from the larger DefinitelyTyped community, which provides a wealth of type definitions and support. The community-driven nature ensures that many popular libraries have readily available type definitions, facilitating integration into TypeScript projects.

  • dts-generator:

    dts-generator has a smaller community compared to other tools, which may result in limited support and resources. However, it is still actively maintained and has a dedicated user base that contributes to its development.

How to Choose: typedoc vs @microsoft/api-extractor vs tsd vs dts-generator
  • typedoc:

    Use typedoc when you need to generate documentation directly from your TypeScript source code. It is perfect for projects where you want to create detailed, customizable documentation that reflects your code structure and types, making it easier for users to understand your API.

  • @microsoft/api-extractor:

    Choose @microsoft/api-extractor if you need a robust solution for managing and publishing TypeScript declaration files. It is ideal for libraries and projects that require detailed API documentation and type definitions, ensuring consistency and quality in your TypeScript projects.

  • tsd:

    Opt for tsd if you are looking for a simple way to manage TypeScript definition files for your projects. It is suitable for developers who want to quickly install and manage type definitions from DefinitelyTyped, making it easier to integrate third-party libraries into TypeScript projects.

  • dts-generator:

    Select dts-generator when you want a lightweight tool to generate TypeScript declaration files from JavaScript code. It is particularly useful for projects that need to provide type definitions for existing JavaScript libraries without extensive TypeScript support.

README for typedoc

TypeDoc

Documentation generator for TypeScript projects.

Documentation

For more detailed documentation, the changelog, and TypeDoc documentation rendered with TypeDoc, see https://typedoc.org.

Installation

TypeDoc runs on Node.js and is available as a NPM package.

npm install typedoc --save-dev

Usage

To generate documentation TypeDoc needs to know your project entry point and TypeScript compiler options. It will automatically try to find your tsconfig.json file, so you can just specify the entry point of your library:

typedoc src/index.ts

If you have multiple entry points, specify each of them.

typedoc package1/index.ts package2/index.ts

If you specify a directory, TypeDoc will use the entryPointStrategy option to determine how to resolve it. By default, TypeDoc will search for a file called index under the directory.

Monorepos / Workspaces

If your codebase is comprised of one or more npm packages, you can build documentation for each of them individually and merge the results together into a single site by setting entryPointStrategy to packages. In this mode TypeDoc requires configuration to be present in each directory to specify the entry points. For an example setup, see https://github.com/Gerrit0/typedoc-packages-example

Arguments

For a complete list of the command line arguments run typedoc --help or visit our website.

  • --out <path/to/documentation/>
    Specifies the location the documentation should be written to. Defaults to ./docs
  • --json <path/to/output.json>
    Specifies the location and file name a json file describing the project is written to. When specified no documentation will be generated unless --out is also specified.
  • --options
    Specify a json option file that should be loaded. If not specified TypeDoc will look for 'typedoc.json' in the current directory.
  • --tsconfig <path/to/tsconfig.json>
    Specify a typescript config file that should be loaded. If not specified TypeDoc will look for 'tsconfig.json' in the current directory.
  • --exclude <pattern>
    Exclude files by the given pattern when a path is provided as source. Supports standard minimatch patterns.

Theming

  • --theme <default|plugin defined theme>
    Specify the theme that should be used.
  • --name <Documentation title>
    Set the name of the project that will be used in the header of the template.
  • --readme <path/to/readme|none>
    Path to the readme file that should be displayed on the index page. Pass none to disable the index page and start the documentation on the globals page.

Miscellaneous

  • --version
    Display the version number of TypeDoc.
  • --help
    Display all TypeDoc options.

Contributing

This project is maintained by a community of developers. Contributions are welcome and appreciated. You can find TypeDoc on GitHub; feel free to open an issue or create a pull request: https://github.com/TypeStrong/typedoc

For more information, read the contribution guide.