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

grace-file-tree

v1.0.4

Published

生成带注释的文件树

Downloads

3

Readme

fileTree功能介绍

  • 该脚本目前只支持输出带注释的文件(注释写法看使用帮助)
  • 生成的的注释后面的 -c是表示注释类型(c为注释类型首字母)
  • 目前只支持'ts', 'js', 'jsx', 'tsx'

┌─components
| ├─ AuthComponents
| | ├─ AuthButton.tsx # 权限按钮组件 -c
| | ├─ AuthContainer.tsx # 自定义权限按钮并支持二次确认弹窗 -c
| | ├─ AuthLink.tsx # 为表格便捷操作的权限text组件(只有拥有权限才能触发text点击事件) -c
| | └─ AuthMenuItem.tsx # 权限菜单按钮 -c
| ├─ Authorized
| | ├─ Authorized.tsx # 权限校验容器组件 -c
| | ├─ CheckPermissions.tsx # 通用权限检查方法 -u
| | ├─ PromiseRender.jsx # 异步权限校验组件 -c
| | ├─ Secured.jsx # 用于判断是否拥有权限访问此 view 权限 -u
| | └─ renderAuthorize.ts # 更新权限方法 -u
| ├─ CustomSelectors
| | ├─ TagSelector.tsx # 标签选择器 -c
| | ├─ ThemeSelect.tsx # 主题选择组件 -c
| | └─ index.tsx # 导出ThemeSelect、TagSelector 组件 -u
| ├─ ProTable
| | └─ index.tsx # ProTable 基于ProTable二次封装表格组件 -c

使用方法

查看使用帮助

output tree -h

生成带注释的文件树

output tree [参数1] [参数2] [参数3] [参数4]

生成不带注释的文件树 只有三个参数

output tree -n [参数1] [参数2] [参数3]

参数说明

目前只有四个参数参数按顺序读取,不能省略,使用默认值需要输入' '占位,如下:output tree [参数1] ' ' [参数3] [参数4]

  • 参数1: 解析目录路径,默认为'./src
  • 参数2:要遍历的目录名使用','隔开不能有空格,支持正则表达式,默认为'pages', 'components'
  • 参数3:生成文件路径,默认为'./fileTree.md'
  • 参数4:要读取的注释类型使用','隔开不能有空格,默认为'component', 'util'

使用帮助

文件中的注释写法必须是下面这种格式才能读取,注释中@后面的名称可以自定义但是不能是注释规范中的单词, 定义的单词首字母会在文件树的注释中体现如'-c', 为了文件树更加简洁脚本自动过滤的没有写注释的文件 。


/**
 * @component 权限按钮组件 <-脚本中会读取该行的注释
 * @props {string} auth 权限名
 * @props {string} env 环境 dev prod test
 * @props {boolean} needPopconfirm 需要Popconfirm二次确认
 *
 */
const AuthButton = (props: IProps) => {
...
}