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

tree-extended

v4.6.0

Published

Helper library and tool for getting customized directory tree representation.

Downloads

264

Readme

Tree Extended

NodeJs make a raw text tree representation of a directory's content. Accept several options

Requires

NodeJs >= 6.x

Install

Install as a node's package.

npm install tree-extended -g

Then, it is just running tree-extended in any directory.

Collaborate

You can contribuite by forking the project on GitHub.

Doc

Run tree-extended -h for view the help.

"tree-extended" is a function for making a directory tree in a text format. You can configure if you want print ascii characters or not. Also has a deep parameter.
    
'tree-extended "Path for making the tree" [-argument1[="valArg1"]] [-argument2[="valArg2"]] [-argument3[="valArg3"]]...[-argument[="valArgn"]]'

arguments:
    (-?, -h, -help): Prints this help
    (-max=max_level): The max deep level
    (-max-show-not-empty): If -max is set and -max-show-not-empty is set, show '...' string when level prune.
    (-[c|charset]=ascii|utf8|utf8-icons): Show an specific charset (default: utf8).
    (-gitignore): Ignore the .git/ folder and the content inside .gitignore file.
    (-ignore="[level1:]folder/file name1,  [level2:]folder/file name2, ..."): Ignores folders or files in an optional tree level.
    (-only="[level1:]folder/file name1,  [level2:]folder/file name2, ..."): Filter and only show that folders or files in an optional tree level.

Screenshot

Screenshot

Samples

Basic

Command: tree-extended

Directory Tree:

├───a/
│   ├───aa/
│   ├───ab/
│   └───ac/
├───a1/
├───b/
│   ├───ba/
│   │   ├───bafile1.txt
│   │   └───bafile2.txt
│   ├───bb/
│   ├───bc/
│   │   └───bca/
│   │       └───bca-file1.txt
│   ├───bd/
│   └───bfile1.txt
├───c/
├───c1/
└───d/
    ├───d1/
    └───d2/

Max Level

Command: tree-extended -max=2

Directory Tree:

├───a/
│   ├───aa/
│   ├───ab/
│   └───ac/
├───a1/
├───b/
│   ├───ba/
│   ├───bb/
│   ├───bc/
│   ├───bd/
│   └───bfile1.txt
├───c/
├───c1/
└───d/
    ├───d1/
    └───d2/

Max Level and Show not empty

Command: tree-extended -max=1 -max-show-not-empty

Directory Tree:

├───a/
│   └───...
├───a1/
├───b/
│   └───...
├───c/
├───c1/
└───d/
    └───...

Custom Charset(s)

With Ascii charset

Command: tree-extended -max=2 -c=ascii

Directory Tree:

+---a/
|   +---aa/
|   +---ab/
|   \---ac/
+---a1/
+---b/
|   +---ba/
|   +---bb/
|   +---bc/
|   +---bd/
|   \---bfile1.txt
+---c/
+---c1/
\---d/
    +---d1/
    \---d2/

With Utf8 Icons charset

Command: tree-extended -max=2 -charset=utf8-icons

Directory Tree:

├───📁 a/
│   ├───📁 aa/
│   └───📁 ab/
├───📁 a1/
├───📁 b/
│   ├───📁 bb/
│   ├───📁 bd/
│   └───📄 bfile1.txt
└───📁 d/
    └───📁 d1/

Ignores

Command: tree-extended -ignore="1:ba, 2:bafile1, c"

Directory Tree:

├───a/
│   ├───aa/
│   └───ab/
├───a1/
├───b/
│   ├───bb/
│   ├───bd/
│   └───bfile1.txt
└───d/
    ├───d1/
    └───d2/

Only

Command: tree-extended -only="0:b, 1:bc, 2:bca"

Directory Tree:

├───b/
│   └───bc/
│       └───bca/
│           └───bca-file1.txt
└───ba/

In this example you can see you can restrict to only one path (or many). But here we can see that like the restriction is 0:b (in the level 0 restric to b) also ba/ is included. For avoiding this, we can use regular expressions in the patterns.

Command: tree-extended -only="0:b$, 1:bc, 2:bca"

Directory Tree:

└───b/
    └───bc/
        └───bca/
            └───bca-file1.txt