Skip to content

Commit 8731907

Browse files
committed
chore: Update package.json and readme.md files
1 parent fa73610 commit 8731907

File tree

2 files changed

+47
-32
lines changed

2 files changed

+47
-32
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"main": "dist/index.js",
66
"bin": {
77
"tree": "./dist/index.js",
8+
"treee": "./dist/index.js",
89
"file-tree": "./dist/index.js",
910
"file-tree-cli": "./dist/index.js"
1011
},

readme.md

Lines changed: 46 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<div align="center">
22
<h2>File Tree CLI</h2>
3-
<!-- <img src="./public/logo.svg" alt="MoviesPrix" width="250" /> -->
43
<p>A modern CLI tool for visualizing directory structures with advanced filtering and display options.</p>
54
</div>
65

@@ -19,16 +18,19 @@
1918
- 💾 Save output to file
2019
- ⚡ Performance optimized
2120

22-
## Installation
21+
## Usage
22+
23+
You can run the CLI tool directly using npx without installation:
2324

2425
```bash
25-
npm install -g file-tree-cli
26+
npx file-tree-cli [options] [directory]
2627
```
2728

28-
## Usage
29+
If you prefer to install it globally (optional):
2930

3031
```bash
31-
tree [options] [directory]
32+
npm install -g file-tree-cli
33+
file-tree [options] [directory]
3234
```
3335

3436
If no directory is specified, the current directory will be used.
@@ -37,56 +39,56 @@ If no directory is specified, the current directory will be used.
3739

3840
```bash
3941
# Display tree of current directory
40-
tree
42+
npx file-tree-cli
4143

4244
# Display tree of specific directory
43-
tree /path/to/directory
45+
npx file-tree-cli /path/to/directory
4446

4547
# Show tree with file sizes
46-
tree -s
48+
npx file-tree-cli -s
4749

4850
# Show only JavaScript and TypeScript files
49-
tree --ext js,ts
51+
npx file-tree-cli --ext js,ts
5052

5153
# Show files modified dates and sizes
52-
tree -s -m
54+
npx file-tree-cli -s -m
5355
```
5456

5557
### Advanced Examples
5658

5759
```bash
5860
# Show only directories, sorted by name
59-
tree --dirs-only --sort name
61+
npx file-tree-cli --dirs-only --sort name
6062

6163
# Show only JavaScript files and their sizes
62-
tree --ext js -s
64+
npx file-tree-cli --ext js -s
6365

6466
# Show tree with custom depth and excluded directories
65-
tree -d 3 -e "dist,coverage"
67+
npx file-tree-cli -d 3 -e "dist,coverage"
6668

6769
# Show all files (including hidden) sorted by size
68-
tree -a --sort size
70+
npx file-tree-cli -a --sort size
6971

7072
# Export tree to a file
71-
tree -o output.txt
73+
npx file-tree-cli -o output.txt
7274
```
7375

7476
## Options
7577

76-
| Option | Description |
77-
| -------------------------- | ---------------------------------------------- |
78-
| `-d, --max-depth <number>` | Maximum depth to traverse |
79-
| `-a, --all` | Show hidden files |
80-
| `-e, --exclude <items>` | Comma-separated list of directories to exclude |
81-
| `-s, --show-size` | Show file sizes |
82-
| `-m, --modified` | Show last modified date |
83-
| `-f, --pattern <pattern>` | Filter items by regex pattern |
84-
| `--ext <extensions>` | Filter by file extensions (comma-separated) |
85-
| `--sort <type>` | Sort items by: name, size, or date |
86-
| `-r, --reverse` | Reverse sort order |
87-
| `--dirs-only` | Show only directories |
88-
| `--files-only` | Show only files |
89-
| `-o, --output <file>` | Save output to file |
78+
| Option | Description | Default |
79+
| -------------------------- | ---------------------------------------------- | ------- |
80+
| `-d, --max-depth <number>` | Maximum depth to traverse ||
81+
| `-a, --all` | Show hidden files | false |
82+
| `-e, --exclude <items>` | Comma-separated list of directories to exclude | [] |
83+
| `-s, --show-size` | Show file sizes | false |
84+
| `-m, --modified` | Show last modified date | false |
85+
| `-f, --pattern <pattern>` | Filter items by regex pattern | null |
86+
| `--ext <extensions>` | Filter by file extensions (comma-separated) | [] |
87+
| `--sort <type>` | Sort items by: name, size, or date | name |
88+
| `-r, --reverse` | Reverse sort order | false |
89+
| `--dirs-only` | Show only directories | false |
90+
| `--files-only` | Show only files | false |
91+
| `-o, --output <file>` | Save output to file | null |
9092

9193
## Output Format
9294

@@ -109,6 +111,7 @@ git clone https://github.com/devxprite/file-tree-cli.git
109111

110112
2. Install dependencies:
111113
```bash
114+
cd file-tree-cli
112115
npm install
113116
```
114117

@@ -117,15 +120,26 @@ npm install
117120
npm run build
118121
```
119122

120-
4. Link for local development:
123+
4. Test locally:
121124
```bash
125+
# Run directly from the project directory
126+
npm start
127+
128+
# Or use npm link for global testing
122129
npm link
130+
tree [options] [directory]
123131
```
124132

125133
## Contributing
126134

127-
Contributions are welcome! Please feel free to submit a Pull Request.
135+
Contributions are welcome! Here's how you can contribute:
136+
137+
1. Fork the repository
138+
2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
139+
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
140+
4. Push to the branch (`git push origin feature/AmazingFeature`)
141+
5. Open a Pull Request
128142

129143
## License
130144

131-
MIT
145+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

0 commit comments

Comments
 (0)