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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@telosh/filetree

v1.0.0

Published

A command-line tool to display directory tree structure

Readme

@telosh/filetree

A command-line tool to display the file tree of a specified directory.

npm version License: MIT

Features

  • Display directory structure in a tree format
  • Customizable depth level
  • File and directory icons support
  • File metadata display (size, last modified date)
  • Gitignore integration
  • Markdown output support
  • Customizable exclusions
  • Size unit conversion

Installation

Install the package globally using npm:

npm install -g @telosh/filetree

Usage

filetree [dirPath] [options]
  • dirPath: The directory path to display the tree structure for. Defaults to the current directory (.).

Options

| Option | Alias | Description | Default | |-----------------------|-------|--------------------------------------------------------------------------|---------------------------| | --level <depth> | -L | Descend only <depth> levels in the directory tree. | Infinity | | --output <filepath> | -o | Write output to a file in Markdown format. | Output to console | | --exclude <dirs> | -e | Comma-separated list of directory names to exclude. | node_modules,.git | | --icons | -i | Display icons for files and directories. | Off | | --metadata | -m | Display file metadata (size, last modified date). | Off | | --size-only | | Display only file size in metadata (requires --metadata). | Off | | --size-unit <unit> | | Specify size unit for metadata (B, KB, MB, GB). | B | | --use-gitignore | | Automatically exclude files and directories found in .gitignore. | Off | | --version | | Display the version number. | | | --help | | Display help for the command. | |

Examples

  1. Display the tree structure of the current directory:

    filetree
  2. Display the tree structure of a specific directory (e.g., src):

    filetree src
  3. Display the tree structure up to 2 levels deep:

    filetree -L 2
  4. Exclude node_modules and dist directories:

    filetree -e node_modules,dist
  5. Save the output to a Markdown file (e.g., tree.md):

    filetree -o tree.md
  6. Display the tree structure with icons:

    filetree -i
  7. Display the tree structure with metadata (size and last modified date):

    filetree -m
  8. Display the tree structure with only file sizes in KB:

    filetree -m --size-only --size-unit KB
  9. Display the tree structure, excluding files and directories from .gitignore:

    filetree --use-gitignore

Development

Prerequisites

  • Node.js >= 18.0.0
  • npm

Setup

  1. Clone the repository:
git clone https://github.com/telosh/fileTree.git
cd fileTree
  1. Install dependencies:
npm install
  1. Build the project:
npm run build

Testing

Run tests:

npm test

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Version History

  • 1.0.0
    • Initial stable release
    • Complete feature set
    • Improved error handling
    • Full documentation

License

This project is licensed under the MIT License. See the LICENSE file for details.