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

@zulfikawr/fstree

v1.1.0

Published

A zero-dependency Bun/Node CLI tool that renders a visual file/folder tree in the terminal and exports it as a file.

Downloads

154

Readme

🌲 fstree

A zero-dependency, high-performance CLI tool to visualize your file system.

Render beautiful, customizable directory trees in your terminal and export them to Markdown, JSON, or Plain Text. Built for speed with Bun, compatible with Node.js.

License: MIT npm version JSR version


✨ Features

  • 🚀 Zero Dependencies: Uses only the standard library.
  • Bun-Native Speed: Blazing fast directory traversal.
  • 📦 Multi-Platform: Works on Windows, macOS, and Linux.
  • 🎨 Beautiful Output: Clean Unicode-based tree structure.
  • 💾 Export Ready: Save to .md, .json, or .txt natively.
  • ⚙️ Smart Defaults: Automatically ignores node_modules, .git, and dist.
  • 📏 Size Aware: Optional file size visualization.

🚀 Quick Start

Run it instantly without installing:

# Using bun
bunx @zulfikawr/fstree

# Using npx
npx @zulfikawr/fstree

Installation

# Using bun
bun install -g @zulfikawr/fstree

# Using npm
npm install -g @zulfikawr/fstree

🛠️ Usage

# Print tree of current directory
fstree

# Target a specific path
fstree ./src

# Limit depth
fstree --depth 2

# Show file sizes
fstree --size

# Include hidden files
fstree --hidden

# Custom ignore patterns
fstree --ignore "temp,cache,build"

📤 Exporting

Perfect for READMEs or automated documentation:

# Export as a Markdown code block
fstree --out structure.md

# Export as a JSON AST
fstree --out structure.json

# Export as plain text
fstree --out structure.txt

📊 CLI Options

| Option | Description | Example | | :--- | :--- | :--- | | path | Target directory (positional) | fstree ./src | | --depth | Max recursion depth | --depth 3 | | --ignore | Comma-separated list to skip | --ignore "dist,out" | | --size | Show human-readable file sizes | --size | | --hidden | Include hidden files/folders | --hidden | | --out | Save output to a file | --out tree.md |


💻 Programmatic API

You can also use fstree as a library in your TypeScript/JavaScript projects:

import { walk } from '@zulfikawr/fstree/walker';
import { renderTree } from '@zulfikawr/fstree/renderer';

const tree = await walk('./src', { 
  depth: 2, 
  ignore: ['node_modules', '.git'] 
});

console.log(renderTree(tree, { showSize: true }));

📄 License

Distributed under the MIT License. See LICENSE for more information.