JSDoc

Documentation for JavaScript


title: "JSDoc" type: doc version: 1 created: 2026-02-28 author: "Wikipedia contributors" status: active scope: public tags: ["free-documentation-generators", "source-code-documentation-formats", "javascript-programming-tools"] description: "Documentation for JavaScript" topic_path: "technology/web" source: "https://en.wikipedia.org/wiki/JSDoc" license: "CC BY-SA 4.0" wikipedia_page_id: 0 wikipedia_revision_id: 0

::summary Documentation for JavaScript ::

::data[format=table title="Infobox file format"]

FieldValue
released
latest release version
latest release date
genreProgramming documentation Format
contained byJavaScript source files
extended fromJavaDoc
openYes
website
::

| name = | icon = | logo = | screenshot = | caption = | extension = | mime = | type code = | uniform type = | magic = | owner = | released = | latest release version = | latest release date = | genre = Programming documentation Format | container for = | contained by =JavaScript source files | extended from =JavaDoc | extended to = | standard = | open = Yes | website =

JSDoc is a markup language used to annotate and document JavaScript code. The comments can be processed by tools to produce documentation in formats such as HTML. The JSDoc specification is released under CC BY-SA 3.0, while its companion documentation generator and parser library is licensed under the Apache License 2.0.

History

JSDoc's syntax and semantics are similar to those of the Javadoc scheme, which is used for documenting code written in Java. JSDoc differs from Javadoc, in that it is specialized to handle JavaScript's dynamic behaviour.

An early example using a Javadoc-like syntax to document JavaScript was released in 1999 with the Netscape/Mozilla project Rhino, a JavaScript run-time system written in Java. It included a toy "JSDoc" HTML generator, versioned up to 1.3, as an example of its JavaScript capabilities.

All main generations of "JSDoc" were headed by Michael Mathews. He started with JSDoc.pm in 2001, a simple system written in Perl. Later, with contributions by Canadian programmer Gabriel Reid. It was hosted on SourceForge in a CVS repository. By JSDoc 1.0 (2007) he rewrote the system in JavaScript (again for Rhino), and after a set of expansions JSDoc 2.0 (2008) gained the name "jsdoc-toolkit". Released under the MIT License, it was hosted in a Subversion repository on Google Code. By 2011 he had refactored the system into JSDoc 3.0 and hosted the result on GitHub. It now runs on Node.js.

JSDoc tags

Some of the more popular annotation tags used in modern JSDoc are:

:{| class="wikitable" ! Tag !! Description |- |@author || Developer's name |- |@constructor|| Marks a function as a constructor |- |@deprecated || Marks a method as deprecated |- |@exception || Synonym for @throws |- |@exports || Identifies a member that is exported by the module |- |@param || Documents a method parameter; a datatype indicator can be added between curly braces |- |@private || Signifies that a member is private |- |@returns || Documents a return value |- |@return || Synonym for @returns |- |@see || Documents an association to another object |- |@todo || Documents something that is missing/open |- |@this || Specifies the type of the object to which the keyword this refers within a function. |- |@throws || Documents an exception thrown by a method |- |@version || Provides the version number of a library |}

JSDoc in use

  • Google's Closure Linter and Closure Compiler. The latter extracts the type information to optimize its output JavaScript.
  • TypeScript can perform type checking for JavaScript files with JSDoc type annotations. Microsoft has specified a new TSDoc language with extensible tags.
  • Sublime Text supports JSDoc through the DocBlockr or DoxyDoxygen plugin
  • The JSDoc syntax has been described at length in the Apress book Foundations of Ajax .
  • Various products of JetBrains, such as IntelliJ IDEA and WebStorm, NetBeans, Visual Studio Code and RubyMine understand JSDoc syntax.
  • Eclipse-based Aptana Studio supports ScriptDoc.
  • Mozile, the Mozilla Inline Editor uses JSDoc.pm.
  • The Helma application framework uses JSDoc.
  • SproutCore documentation was generated using JSDoc.
  • Visual Studio, WebStorm and many other Integrated development environments or Text Editors offer Code Completion and other assistance based on JSDoc comments.
  • Open source Atom editor supports JSDoc via the atom-easy-jsdoc plugin.

References

References

  1. (May 6, 1999). "Rhino example: jsdoc.js". Mozilla project.
  2. (15 April 2013). "JSDoc".
  3. "jsdoc-toolkit".
  4. (4 September 2019). "JSDoc". jsdoc.
  5. "Type Checking JavaScript Files".

::callout[type=info title="Wikipedia Source"] This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page. ::

free-documentation-generatorssource-code-documentation-formatsjavascript-programming-tools