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

dftree

v1.0.1

Published

`dftree` is an [npm package that generates a visual representation of a directory structure using Unicode box-drawing characters.](https://www.npmjs.com/package/dftree)

Downloads

3

Readme

dftree - Detailed File Tree Generator

dftree is an npm package that generates a visual representation of a directory structure using Unicode box-drawing characters.

Installation

npm install -g dftree to install this package globally using npm

To add using bun,

bun add -g dftree to install this package globally using bun

It generates detailed tree diagrams using UNICODE characters in this specific format:

. (17 visible files, 0 hidden files, 16 visible directories, 0 hidden directories, 8.34 MB overall size)
├── Dockerfile
├── Gemfile (3 hidden files, 7 visible files, 1.00 KB overall size)
├── Gemfile.lock
├── README.md
├── Rakefile (4 hidden files, 2 visible files, 8 MB overall size)
├── app (8 hidden files, 2 visible files, 8 MB overall size)
│   ├── controllers (8 hidden files, 2 visible files, 8 MB overall size)
│   ├── models (8 hidden files, 2 visible files, 8 MB overall size)
│   ├── views (8 hidden files, 2 visible files, 8 MB overall size)
│   └── ... (additional subdirectories)
├── bin (5 hidden files, 2 visible files, 8 MB overall size)
│   └── rails
├── config (5 hidden files, 2 visible files, 8 MB overall size)
│   ├── environments (8 hidden files, 2 visible files, 8 MB overall size)
│   ├── initializers (8 hidden files, 2 visible files, 8 MB overall size)
│   └── ... (additional subdirectories)
├── config.ru
├── db (7 hidden files, 4 visible files, 8 MB overall size)
│   └── migrate (8 hidden files, 2 visible files, 8 MB overall size)
├── lib (3 hidden files, 7 visible files, 8 MB overall size)
│   └── tasks (8 hidden files, 2 visible files, 8 MB overall size)
├── log (0 hidden files, 7 visible files, 8 MB overall size)
├── public (8 hidden files, 7 visible files, 8 MB overall size)
│   ├── assets (8 hidden files, 2 visible files, 8 MB overall size)
│   └── ... (additional subdirectories)
├── storage (8 hidden files, 5 visible files, 8 MB overall size)
├── test (8 hidden files, 7 visible files, 8 MB overall size)
│   ├── controllers (8 hidden files, 2 visible files, 8 MB overall size)
│   ├── models (8 hidden files, 2 visible files, 8 MB overall size)
│   └── ... (additional subdirectories)
├── tmp (8 hidden files, 2 visible files, 8 MB o:verall size)
│   ├── cache (8 hidden files, 2 visible files, 8 MB overall size)
│   └── ... (additional subdirectories)
└── vendor (8 hidden files, 2 visible files, 8 KB overall size)

Usage

  1. Run dftree in your directory

  2. To specify a depth level, use the -L option:

    dftree -L 2

    This will display the file tree up to the specified depth level.

Options

  • -L <depth>: Set the maximum depth level for the file tree.

Output

The script will display the file tree using Unicode box-drawing characters. Each directory is represented by a folder icon (├──) and each file is represented by a file icon (├── filename).

If a depth level is specified, the script will also display the number of visible files, hidden files, visible directories, hidden directories, and the overall size of each directory.

License

This script is licensed under the MIT License.