This package provides an easy way to insert JSDoc function comments and typedefs. It leverages a variety of techniques to generate documentation as much as possible without human interaction, including type inference and other similar approaches.
Also has basic TypeScript support, using TSDoc style.
Please note that this package is only compatible with Emacs 29 or newer versions that support tree-sitter. If you are using Emacs 28 or an earlier version, please refer to the emacs-28-and-below branch, which utilizes the tree-sitter package.
To use this package, you can call the interactive command jsdoc
. If your cursor is on a function definition, the command will insert a JSDoc-style function documentation comment. If your cursor is on a JavaScript object, the command will insert a JSDoc @typedef
comment.
jsdoc is available through MELPA. If you have it set up already, just do M-x package-install jsdoc
and you are good to go. Otherwise please see MELPA getting started page to learn how you can install packages through MELPA or see the following installation options.
Alternatively, you can use the straight or quelpa package managers in conjunction with use-package
.
;; Using straight
(use-package jsdoc
:straight (:host github :repo "isamert/jsdoc.el"))
;; Using quelpa
(use-package jsdoc
:quelpa (jsdoc :fetcher github :repo "isamert/jsdoc.el"))
- ananthakumaran/tide
- The command
tide-jsdoc-template
inserts a JSDoc template for your function. It’s meant to be simple, no advanced stuff. It also requirestide-mode
enabled (which runstsserver
). - mooz/js-doc
- Another package in the spirit of this one. Seems to have quite advanced stuff but didn’t get it to work. Haven’t got updated for a while.