apidoc vs documentation vs jsdoc vs swagger-jsdoc
JavaScript Documentation Tools
apidocdocumentationjsdocswagger-jsdocSimilar Packages:

JavaScript Documentation Tools

JavaScript documentation tools are essential for generating and maintaining documentation for APIs and codebases. They help developers create clear, structured, and accessible documentation that can be easily integrated into projects. These tools facilitate better understanding, usage, and maintenance of APIs, ultimately improving collaboration among developers and enhancing the overall quality of software projects. Each tool has its unique features and use cases, catering to different documentation needs and preferences.

Npm Package Weekly Downloads Trend

3 Years

Github Stars Ranking

Stat Detail

Package
Downloads
Stars
Size
Issues
Publish
License
apidoc09,671556 kB853 years agoMIT
documentation05,8041.88 MB2022 years agoISC
jsdoc015,4321.47 MB4517 months agoApache-2.0
swagger-jsdoc01,790712 kB473 years agoMIT

Feature Comparison: apidoc vs documentation vs jsdoc vs swagger-jsdoc

Documentation Format

  • apidoc:

    Apidoc generates documentation in a simple HTML format, focusing primarily on RESTful APIs. It provides a clean and user-friendly interface for API consumers.

  • documentation:

    Documentation.js can output documentation in various formats, including HTML, Markdown, and JSON, making it versatile for different use cases and audiences.

  • jsdoc:

    JSDoc primarily generates HTML documentation, but it can also produce other formats with plugins. It is highly customizable, allowing developers to tailor the output to their needs.

  • swagger-jsdoc:

    Swagger-jsdoc generates OpenAPI specifications in JSON format, which can be used with Swagger UI to create interactive API documentation. This is particularly useful for API consumers who want to explore and test endpoints.

Ease of Use

  • apidoc:

    Apidoc is straightforward to set up and use, requiring minimal configuration. Its simplicity makes it ideal for projects that need quick documentation without extensive setup.

  • documentation:

    Documentation.js has a moderate learning curve, as it supports various features and configurations. However, once set up, it provides a flexible documentation generation process.

  • jsdoc:

    JSDoc is widely recognized and has extensive documentation and community support, making it relatively easy to learn. Its established conventions help new users get started quickly.

  • swagger-jsdoc:

    Swagger-jsdoc is easy to use if you are already familiar with JSDoc syntax. It integrates seamlessly into existing projects, but understanding OpenAPI specifications is necessary for effective use.

Customization

  • apidoc:

    Apidoc offers limited customization options compared to other tools. It focuses on generating straightforward API documentation without extensive configuration.

  • documentation:

    Documentation.js provides a high level of customization, allowing developers to define their own templates and styles for the generated documentation.

  • jsdoc:

    JSDoc is highly customizable, supporting various tags and plugins that allow developers to extend its functionality and tailor the output to specific requirements.

  • swagger-jsdoc:

    Swagger-jsdoc allows for customization of OpenAPI specifications through JSDoc comments, enabling developers to define detailed API behaviors and parameters.

Community and Support

  • apidoc:

    Apidoc has a smaller community compared to other tools, but it is still actively maintained and has a decent amount of resources available for users.

  • documentation:

    Documentation.js has a growing community and offers good support through GitHub and documentation, making it easier for users to find help and resources.

  • jsdoc:

    JSDoc boasts a large and active community, with extensive documentation, tutorials, and plugins available. This makes it one of the most supported documentation tools in the JavaScript ecosystem.

  • swagger-jsdoc:

    Swagger-jsdoc benefits from the larger OpenAPI community, providing ample resources, examples, and support for users looking to implement API documentation effectively.

Integration

  • apidoc:

    Apidoc can be easily integrated into existing projects with minimal setup, making it a convenient choice for teams looking to add documentation without significant changes to their workflow.

  • documentation:

    Documentation.js can integrate with various build tools and workflows, making it suitable for projects that require flexible documentation generation as part of their CI/CD processes.

  • jsdoc:

    JSDoc integrates well with many build systems and can be easily incorporated into existing projects, making it a popular choice among developers.

  • swagger-jsdoc:

    Swagger-jsdoc is designed to work seamlessly with Swagger UI, allowing for a smooth integration of documentation and API testing, which is beneficial for teams focused on API development.

How to Choose: apidoc vs documentation vs jsdoc vs swagger-jsdoc

  • apidoc:

    Choose Apidoc if you need a simple and straightforward solution for generating API documentation directly from your code comments. It is particularly useful for RESTful APIs and allows for easy integration with existing projects.

  • documentation:

    Opt for Documentation.js if you are looking for a versatile tool that can generate documentation in multiple formats (HTML, Markdown, etc.) and supports ES6 features. It's great for projects that require a more comprehensive documentation solution that can adapt to various formats.

  • jsdoc:

    Select JSDoc if you want a widely adopted and robust documentation generator that supports a variety of JavaScript features and allows for extensive customization. It's ideal for projects that require detailed API documentation and have a large codebase.

  • swagger-jsdoc:

    Use Swagger-jsdoc if you are working with REST APIs and want to create OpenAPI (formerly Swagger) specifications directly from your JSDoc comments. This tool is perfect for teams looking to integrate API documentation with API design and testing.

README for apidoc

apiDoc

apiDoc creates a documentation from API descriptions in your source code.

validate NPM version Join the chat at https://gitter.im/apidoc/talk

Documentation: apidocjs.com

Live DEMO

Installation

$ npm install -g apidoc

Usage

Add some apidoc comments anywhere in your source code:

/**
 * @api {get} /user/:id Request User information
 * @apiName GetUser
 * @apiGroup User
 *
 * @apiParam {Number} id User's unique ID.
 *
 * @apiSuccess {String} firstname Firstname of the User.
 * @apiSuccess {String} lastname  Lastname of the User.
 */

Now generate the documentation from src/ into doc/.

$ apidoc -i src/ -o doc/

This repository contains and example folder from which you can generate a very complete documentation on an example api endpoint. It also contains best practice hints (in the footer.md file).

$ git clone https://github.com/apidoc/apidoc && cd apidoc
$ npm install --prod
$ ./bin/apidoc -i example -o /tmp/doc
$ $BROWSER /tmp/doc

Programmatic usage

You can generate the documentation programmatically:

import path from 'path'
import { createDoc } from 'apidoc'

const doc = createDoc({
  src: path.resolve(__dirname, 'src'),
  dest: path.resolve(__dirname, 'doc'), // can be omitted if dryRun is true
  // if you don't want to generate the output files:
  dryRun: true,
  // if you don't want to see any log output:
  silent: true,
})

if (typeof doc !== 'boolean') {
  // Documentation was generated!
  console.log(doc.data) // the parsed api documentation object
  console.log(doc.project) // the project information
}

Install type definitions (see @types/apidoc):

$ npm install -D @types/apidoc

Docker image

You can use apidoc in Docker like this:

# first build the image after cloning this repository
docker build -t apidoc/apidoc .
# run it
docker run --rm -v $(pwd):/home/node/apidoc apidoc/apidoc -o outputdir -i inputdir

Supported programming languages

  • C#, Go, Dart, Java, JavaScript, PHP, Scala (all DocStyle capable languages):

    /**
      * This is a comment.
      */
    
  • Clojure:

    ;;;;
    ;; This is a comment.
    ;;;;
    
  • CoffeeScript:

    ###
    This is a comment.
    ###
    
  • Elixir:

    #{
    # This is a comment.
    #}
    
  • Erlang:

    %{
    % This is a comment.
    %}
    
  • Perl

    #**
    # This is a comment.
    #*
    
    =pod
    This is a comment.
    =cut
    
  • Python

    """
    This is a comment.
    """
    
  • Ruby

    =begin
    This is a comment.
    =end
    

Plugins (extend apiDoc)

apiDoc will auto include installed plugins.

  • apidoc-plugin-schema Generates and inject apidoc elements from api schemas. npm install apidoc-plugin-schema

For details and an example on how to implement your own plugin, please view apidoc-plugin-test.

Support

Please create a new issue if you have a suggestion/question or if you found a problem/bug.

Contributing

apiDoc is a collaborative project. Pull requests are welcome. Please see the CONTRIBUTING file.

Build tools

Integration

Converter