0.2.3 • Published 8 months ago

@zzw_105/file-tree v0.2.3

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

file-tree

输出带注释的项目文件树

输出效果

F:\project\tree
├─file-tree --------------------------- fileTree文件夹
|  ├─config.json ---------------------- 配置文件
|  ├─fileComment.json ----------------- 文件注释缓存
|  └─fileTree.md ---------------------- 输出文件
├─test -------------------------------- 测试
|  ├─a -------------------------------- a
|  |  ├─d ----------------------------- d
|  |  |  └─e.js ----------------------- e
|  ├─b -------------------------------- b
|  |  └─f.ts -------------------------- 啊实打实大
|  └─c.txt ---------------------------- c
├─util
|  ├─defaultConfig.json --------------- 默认配置
|  ├─index.ts
|  └─type.ts
├─.gitignore
├─README.md
├─index.ts ---------------------------- 入口文件
├─package-lock.json
├─package.json
└─tsconfig.json

安装依赖

请在项目中安装,请勿全局安装

npm i @zzw_105/file-tree

使用

  1. 运行file-tree --init初始化项目

  2. 编辑config.json添加需要忽略的文件或者文件

    {
      "ignore": [
        "node_modules",
        ".git",
        "dist",
        "yarn.lock"
      ],
      "dashLength": 40
    }
  3. 命令行运行file-tree

  4. 更具提示输入响应需要的注释

  5. 输出文件地址为\file-tree\fileTree.md

终端参数

  • -i,--init 初始化项目
  • -s,--skip 跳过标注

config配制

  • ignore:string[] 忽略的文件和文件夹
  • dashLength:number 输出文件的破折号长度
  • ignoreExtension:string[] 忽略的扩展名
  • ignoreFolder:string[] 忽略特定文件夹下的所有文件

ignoreFolder内的文件夹依然会在最终的树中显示,但文件夹下的所以文件将被忽略

问题

  1. 修改已经写好的注释

    可以在fileComment.json文件中找到对应的文件路径修改

计划更新

  • 支持全局使用以及命令参数
  • 路径改为项目根目录为起始
  • 更好的视觉显示效果
  • 增加init功能

感谢

部分代码借鉴了treer包

treer npm

treer github

0.2.3

8 months ago

0.2.1

8 months ago

0.2.0

8 months ago

0.1.3

8 months ago

0.1.1

8 months ago

0.1.0

8 months ago

0.0.8

8 months ago

0.0.7

8 months ago

0.0.6

8 months ago

0.0.5

8 months ago

0.0.4

8 months ago

0.0.3

8 months ago

0.0.2

8 months ago

0.0.1

8 months ago