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 🙏

© 2026 – Pkg Stats / Ryan Hefner

treef

v1.0.6

Published

输出指定目录的文件与文件夹结构 CLI tool to print folder and file tree with ignore options

Readme

treef

一个简洁实用的命令行工具,用于递归输出指定目录的文件与文件夹结构,同时支持忽略特定文件夹。

A simple CLI tool to recursively display the folder and file tree of a directory, with support for ignoring specified folders.


Features

功能特性 Features 📁 递归展示目录结构 — 自动列出所有子文件与文件夹

🌲 树状结构输出 — 使用符号清晰表示文件层级

🚫 忽略文件夹支持 — 默认忽略常见目录,可手动添加

🧩 显示全部模式 — 使用 --all 参数可无视忽略规则

🖥️ 命令行简单易用

Recursively lists all files and folders

Displays a clean, indented tree-like structure

Supports ignoring specified folders (default: node_modules, dist, .git, test)

--all flag disables all ignore rules

Intuitive CLI experience

  • Recursively lists all files and folders.
  • Displays a clean tree-like structure.
  • Supports ignoring specified folders and their contents.
  • Easy to use from command line.

treef

一个简单的命令行工具,用于递归打印指定目录下的文件和文件夹结构,并支持忽略指定的文件夹。


功能特性

  • 递归列出所有文件和文件夹。
  • 以清晰的树状结构展示。
  • 支持忽略指定的文件夹及其所有子内容。
  • 命令行简单易用。

Installation 安装

npm install -g treef

Usage 用法

treef <directory> [--ignore folder1,folder2,...] [--all]

  • directory: 目标目录路径。

  • --ignore: 可选,逗号分隔的文件夹名列表,忽略这些文件夹及其子内容。

  • --all 会覆盖默认和自定义的忽略列表。

📂 默认忽略目录(当未使用 --all 时)

node_modules, dist, .git, test

Example 示例

# 忽略默认目录(node_modules, dist 等)
treef .

# 忽略默认目录 + 自定义 ignore logs 和 build
treef ./src --ignore logs,build

# 显示所有文件与文件夹(包括 node_modules、.git 等)
treef . --all

License 许可协议

MIT License

👤 作者 Author

appleStven 📧 [email protected]