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

@zzw_105/file-tree

v0.3.0

Published

输出带注释的项目文件树

Downloads

53

Readme

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[] 忽略特定目录下的所有文件
  • ignoreFilesInFolder:string[] 只显示特定目录下的目录注释

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

问题

  1. 修改已经写好的注释

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

计划更新

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

感谢

部分代码借鉴了treer包

treer npm

treer github