@daybrush/jsdoc

中文文档
0.4.7发布于 2023/01/28Apache-2.0近 30 天下载 1.6万

An API documentation generator for JavaScript and Typescript.

原始使用文档
文档目录13 节
  1. Support Typescript from version 0.3.0
  2. name and type can be omitted in function and method
  3. extends and implements can be omitted from the class.
  4. Supports type declaration
  5. Supports interface declaration
  6. jsdoc.json (Add ts extension to includePattern)
  7. Installation and Usage
  8. Templates and Tools
  9. Templates
  10. Build Tools
  11. Other Tools
  12. For More Information
  13. License

@daybrush/jsdoc npm version

npm install --save-dev @daybrush/jsdoc

Support Typescript from version 0.3.0

name and type can be omitted in function and method

  • jsdoc
/**
 */
function a(a: Parameter1, b: Parameter2): ReturnType {
}
  • result

extends and implements can be omitted from the class.

  • jsdoc
/**
*/
export class A extends B implements a {
}
  • result


Supports type declaration

  • jsdoc
/**
 * @typedef
 */
export type a<T> = () => T;
  • result


Supports interface declaration

  • jsdoc
/**
 * @typedef
 */
export interface a {
    a: string;
    b: number;
    c: () => void;
    d(a: string, b: number): void;
    (a: string, b: number): void;
    [key: string]: any;
}
  • result


jsdoc.json (Add ts extension to includePattern)

{
    "source": {
        "includePattern": ".+\\.(j|t)s(doc|x)?$",
    },
}

JSDoc 3

Build Status

An API documentation generator for JavaScript.

Want to contribute to JSDoc? Please read CONTRIBUTING.md.

Installation and Usage

JSDoc supports Node.js 4.2.0 and later. You can install JSDoc globally or in your project's node_modules folder.

To install the latest version on npm globally (may require sudo; learn how to fix this):

npm install -g jsdoc

To install the latest version on npm locally and save it in your package's package.json file:

npm install --save-dev jsdoc

Note: By default, npm adds your package using the caret operator in front of the version number (for example, ^3.5.2). We recommend using the tilde operator instead (for example, ~3.5.2), which limits updates to the most recent patch-level version. See this Stack Overflow answer for more information about the caret and tilde operators.

To install the latest development version locally, without updating your project's package.json file:

npm install git+https://github.com/jsdoc3/jsdoc.git

If you installed JSDoc locally, the JSDoc command-line tool is available in ./node_modules/.bin. To generate documentation for the file yourJavaScriptFile.js:

./node_modules/.bin/jsdoc yourJavaScriptFile.js

Or if you installed JSDoc globally, simply run the jsdoc command:

jsdoc yourJavaScriptFile.js

By default, the generated documentation is saved in a directory named out. You can use the --destination (-d) option to specify another directory.

Run jsdoc --help for a complete list of command-line options.

Templates and Tools

The JSDoc community has created numerous templates and other tools to help you generate and customize your documentation. Here are just a few:

Templates

Build Tools

Other Tools

For More Information

License

JSDoc 3 is copyright (c) 2011-present Michael Mathews [email protected] and the contributors to JSDoc.

JSDoc 3 is free software, licensed under the Apache License, Version 2.0. See the file LICENSE.md in this distribution for more details.

版本与发布记录

@daybrush/jsdoc 共发布 46 个版本,首次发布于 2018/08/14;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.4.7latest2023/01/283 年前
0.4.62023/01/283 年前
0.4.52023/01/043 年前
0.4.42022/12/313 年前
0.4.32022/08/314 年前
0.4.22022/08/314 年前

关于 @daybrush/jsdoc 的常见问题

@daybrush/jsdoc 是什么?

An API documentation generator for JavaScript and Typescript.

如何安装 @daybrush/jsdoc?

在项目目录运行 npm install @daybrush/jsdoc,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 jsdoc,可以用 npx jsdoc 直接运行。

@daybrush/jsdoc 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/daybrush__jsdoc 是否存在。

@daybrush/jsdoc 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=4.2.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@daybrush/jsdoc 可以商用吗?

@daybrush/jsdoc 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@daybrush/jsdoc 的下载量有多少?

根据 npm 官方下载统计,@daybrush/jsdoc 在 2026/10/12 – 2026/11/10 这 30 天内被下载 16,150 次,日均约 538 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@daybrush/jsdoc 还在维护吗?

最新版本 0.4.7 发布于 2023/01/28(3 年前);至今共发布 46 个版本,其中过去 12 个月发布了 0 个;首次发布于 2018/08/14。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。