npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

jsdoc-comment

v0.0.9

Published

JsDoc注释处理器,输出json数据, jsdoc comment generator, output json data

Downloads

3

Readme

JsDoc格式Vue文档生成工具

项目功能 🔨

jsdoc-comment 是一个基于 Node.js 开发的工具,根据 YAML 配置,自动生成包含注释内容的JSON数据,方便二次加工处理。

安装使用步骤

安装

你可以使用 npm 或 yarn 来安装 jsdoc-comment:

npm install -D jsdoc-comment
# 或者
yarn add -D jsdoc-comment

使用

# 配置文件默认路径为 /jsdoc-comment.yaml
# 可通过命令行参数 -c /path/to/config.yaml 指定配置文件位置
input:
   folderPath: "/src/components" # 指定需处理的组件所在文件夹路径
   file: "**/src/*.vue" # 指定组件文件名

output:
   # 输出mode有2种方式:
   # 1、 seperate 在组件的目录为基准,以下面的输出目录为相对目录,生成以组件名+.json的文件
   # 2、 combine 以下面配置的路径和文件将所有组件信息写在统一的json文件中
   mode: seperate # 默认
   doctags: # 定义需要输出到文档的标签类型,
      # JsDoc格式必须是
      # /**
      #  * @component/@props/@emits/@slots 后面不要加其它内容
      #  * @name 等等其它标签
      # */
      - "@component" # 组件注释
      - "@props" # 属性注释
      - "@emits" # 事件注释
      - "@slots" # 插槽注释
   outputDir: "../docs/" # 指定输出目录  combine时,目录从根目录算,seperate时,目录是根据组件所在位置的相对位置
   outputName: "comments.json" # combine时,指定输出文件名,seperate时无效

package.json 中添加以下脚本:

"scripts": {
  "jsdoc": "jsdoc-comment [-c config.yaml]"  /// [-c config.yaml] 可选
}

然后,你可以运行以下命令来生成注释Json:

npm run jsdoc
# 或者
yarn jsdoc

详细配置参数说明

input (必填),输入配置。

  • folderPath(必填): 指定需处理的组件所在文件夹路径

  • file(必填): 指定组件文件名,支持**和*

output 输出配置:

  • mode: (必填)输出mode有2种方式:

    • 1、 seperate 在组件的目录为基准,以下面的输出目录为相对目录,生成以组件名+.json的文件
    • 2、 combine 以下面配置的路径和文件将所有组件信息写在统一的json文件中
  • doctags(必填): 定义需要输出到文档的标签类型

  • outputDir(必填): 指定输出目录

    • combine时,目录从根目录算,
    • seperate时,目录是根据组件所在位置的相对位置
  • outputName(可选): 输出文件名

    • combine时,指定输出文件名,
    • seperate时,无效

Git commit ⻛格指南

  • feat: 增加新功能
  • fix: 修复问题
  • style: 代码⻛格相关⽆影响运⾏结果的
  • perf: 优化/性能提升
  • refactor: 重构
  • revert: 撤销修改
  • test: 测试相关
  • docs: ⽂档/注释
  • chore: 依赖更新/脚⼿架配置修改等
  • ci: 持续集成

许可证

该项目基于 MIT 许可证进行分发。更多详情请参阅 LICENSE 文件。