Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/morinokami/ptree
tree command prettified with emojisπ²
https://github.com/morinokami/ptree
Last synced: 10 days ago
JSON representation
tree command prettified with emojisπ²
- Host: GitHub
- URL: https://github.com/morinokami/ptree
- Owner: morinokami
- License: mit
- Created: 2022-01-21T16:59:25.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-06T05:12:04.000Z (almost 2 years ago)
- Last Synced: 2024-12-16T02:45:52.559Z (12 days ago)
- Language: TypeScript
- Homepage:
- Size: 710 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ptree
ptree prettifies `tree` command with emojis like this:
```
$ ptree
π .
βββ π€ binary.bin
βββ π document.txt
βββ π¦ javascript.js
βββ π markdown.md
βββ πͺ perl.pl
βββ π python.py
βββ π¦ rust.rs0 directory, 7 files
```## Installation
```sh
$ npm install -g @shf0811/ptree
```## Usage
* List contents of directories:
```
$ ptree .
π .
βββ π bar
β βββ π baz.ts
βββ π foo.js1 directory, 2 files
```* Specify the maximum display depth of the directory tree:
```
$ ptree --level 1 .
π .
βββ π bar
βββ π foo.js1 directory, 1 file
```* Specify the emojis to show:
```
$ ptree --emojis '{".js": "π¦", ".ts": "π¦"}' .
π .
βββ π bar
β βββ π¦ baz.ts
βββ π¦ foo.js1 directory, 2 files
```* List only directories:
```
$ ptree --dir .
π .
βββ π bar1 directory
```* List only those files that matches the given pattern:
```
$ ptree --include 'foo*' .
π .
βββ π bar
βββ π foo.js1 directory, 1 file
```* List only those files that doesn't match the given pattern:
```
$ ptree --exclude 'foo*' .
π .
βββ π bar
βββ π baz.ts1 directory, 1 file
```* Show help:
```
$ ptree --help
ptree [options]Options:
--version Show version number [boolean]
-a, --all Print all files and directories including those starting with a
dot [boolean] [default: false]
-d, --dir Print only directories [boolean] [default: false]
-e, --emojis Mapping of file extensions to emojis [string] [default: "{}"]
-l, --level Maximum depth to traverse [number] [default: Infinity]
-i, --include Include files matching this pattern [string]
-x, --exclude Exclude files matching this pattern [string]
-h, --help Show help [boolean]
```## Customization
You can specify the emojis to use beforehand by creating a config file named `.ptree.json` in your home folder like this:
```
$ cat ~/.ptree.json
{
"emojis": {
".js": "π¦",
".ts": "π¦"
}
}
```Now you don't have to use the option each time:
```
$ ptree .
π .
βββ π bar
β βββ π¦ baz.ts
βββ π¦ foo.js1 directory, 2 files
```