folder-generator 1.3.5 ā 1.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +137 -152
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,152 +1,137 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
š¦ Installation
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
bash
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
āāā
|
|
67
|
-
|
|
68
|
-
āāā
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
āāā
|
|
102
|
-
ā
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
āāā
|
|
115
|
-
ā āāā
|
|
116
|
-
āāā
|
|
117
|
-
ā āāā
|
|
118
|
-
āāā
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
bash
|
|
139
|
-
sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}
|
|
140
|
-
Error: Missing input
|
|
141
|
-
Solution: Either provide --input, --file, or pipe content to the command
|
|
142
|
-
|
|
143
|
-
š¤ Contributing
|
|
144
|
-
Fork the repository
|
|
145
|
-
|
|
146
|
-
Create a feature branch (git checkout -b feature/awesome-feature)
|
|
147
|
-
|
|
148
|
-
Commit your changes (git commit -am 'Add awesome feature')
|
|
149
|
-
|
|
150
|
-
Push to the branch (git push origin feature/awesome-feature)
|
|
151
|
-
|
|
152
|
-
Open a Pull Request
|
|
1
|
+
# š Folder Structure Generator CLI
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/folder-structure-generator)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
|
|
6
|
+
A powerful CLI tool that generates complete folder structures from simple text diagrams. Perfect for quickly scaffolding projects, boilerplates, or standardized directory layouts.
|
|
7
|
+
|
|
8
|
+
## ⨠Features
|
|
9
|
+
|
|
10
|
+
- Generate nested folders and files with a single command
|
|
11
|
+
- Supports both direct input and file input
|
|
12
|
+
- Cross-platform (Windows, macOS, Linux)
|
|
13
|
+
- Clear visual feedback with color-coded output
|
|
14
|
+
- Flexible output directory specification
|
|
15
|
+
- Lightweight with minimal dependencies
|
|
16
|
+
|
|
17
|
+
## š¦ Installation
|
|
18
|
+
|
|
19
|
+
### Global Installation (Recommended)
|
|
20
|
+
```bash
|
|
21
|
+
npm install -g folder-structure-generator
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Local Installation
|
|
25
|
+
```bash
|
|
26
|
+
npm install folder-structure-generator --save-dev
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## š Usage
|
|
30
|
+
|
|
31
|
+
### From Direct Input
|
|
32
|
+
```bash
|
|
33
|
+
foldgen --input "src/
|
|
34
|
+
āāā App.js
|
|
35
|
+
āāā index.js
|
|
36
|
+
āāā components/
|
|
37
|
+
āāā Button.js
|
|
38
|
+
āāā Header.js"
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### From File
|
|
42
|
+
```bash
|
|
43
|
+
foldgen --file structure.txt
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### From STDIN (Piping)
|
|
47
|
+
```bash
|
|
48
|
+
echo "config/
|
|
49
|
+
āāā default.json
|
|
50
|
+
āāā production.json" | foldgen
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Specify Output Directory
|
|
54
|
+
```bash
|
|
55
|
+
foldgen --file structure.txt --output ./my-project
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## š Syntax Guide
|
|
59
|
+
|
|
60
|
+
The generator understands standard tree diagram notation:
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
project/
|
|
64
|
+
āāā README.md
|
|
65
|
+
āāā src/
|
|
66
|
+
ā āāā index.js
|
|
67
|
+
ā āāā utils/
|
|
68
|
+
ā āāā helpers.js
|
|
69
|
+
āāā tests/
|
|
70
|
+
āāā index.test.js
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**Special Characters:**
|
|
74
|
+
|
|
75
|
+
- `āāā` for intermediate items
|
|
76
|
+
- `āāā` for the last item in a level
|
|
77
|
+
- `ā` for vertical connections
|
|
78
|
+
- Spaces for indentation (4 spaces per level)
|
|
79
|
+
|
|
80
|
+
## š ļø Programmatic API
|
|
81
|
+
|
|
82
|
+
```javascript
|
|
83
|
+
const { parseStructure, createFiles } = require('folder-structure-generator');
|
|
84
|
+
|
|
85
|
+
const structure = parseStructure(`src/index.js`);
|
|
86
|
+
createFiles(structure, './output');
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## š Example Structure Files
|
|
90
|
+
|
|
91
|
+
**React Project (react-structure.txt):**
|
|
92
|
+
```
|
|
93
|
+
src/
|
|
94
|
+
āāā App.jsx
|
|
95
|
+
āāā index.js
|
|
96
|
+
āāā components/
|
|
97
|
+
ā āāā Button/
|
|
98
|
+
ā ā āāā index.jsx
|
|
99
|
+
ā ā āāā styles.module.css
|
|
100
|
+
ā āāā Header.jsx
|
|
101
|
+
āāā pages/
|
|
102
|
+
ā āāā Home.jsx
|
|
103
|
+
āāā utils/
|
|
104
|
+
āāā api.js
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**Node.js API (node-structure.txt):**
|
|
108
|
+
```
|
|
109
|
+
app/
|
|
110
|
+
āāā config/
|
|
111
|
+
ā āāā database.js
|
|
112
|
+
āāā controllers/
|
|
113
|
+
ā āāā userController.js
|
|
114
|
+
āāā models/
|
|
115
|
+
ā āāā User.js
|
|
116
|
+
āāā routes/
|
|
117
|
+
ā āāā api.js
|
|
118
|
+
āāā app.js
|
|
119
|
+
āāā package.json
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## š¤ Contributing
|
|
123
|
+
|
|
124
|
+
- Fork the repository
|
|
125
|
+
- Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
126
|
+
- Commit your changes (`git commit -m 'Add some amazing feature'`)
|
|
127
|
+
- Push to the branch (`git push origin feature/amazing-feature`)
|
|
128
|
+
- Open a Pull Request
|
|
129
|
+
|
|
130
|
+
## š License
|
|
131
|
+
|
|
132
|
+
MIT Ā© [Your Name]
|
|
133
|
+
|
|
134
|
+
## š Acknowledgments
|
|
135
|
+
|
|
136
|
+
- Inspired by the need for quick project scaffolding
|
|
137
|
+
- Built with Node.js and love
|