make-folder-txt 2.2.0 → 2.2.2
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/bin/make-folder-txt.js +597 -336
- package/make-folder-txt.txt +430 -0
- package/package.json +1 -1
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
================================================================================
|
|
2
|
+
START OF FOLDER: make-folder-txt
|
|
3
|
+
================================================================================
|
|
4
|
+
|
|
5
|
+
================================================================================
|
|
6
|
+
PROJECT STRUCTURE
|
|
7
|
+
================================================================================
|
|
8
|
+
Root: C:\Programming\make-folder-txt
|
|
9
|
+
|
|
10
|
+
make-folder-txt/
|
|
11
|
+
├── .git/ [skipped]
|
|
12
|
+
├── bin/ [skipped]
|
|
13
|
+
├── .txtconfig
|
|
14
|
+
├── LICENSE
|
|
15
|
+
├── package.json
|
|
16
|
+
└── README.md
|
|
17
|
+
|
|
18
|
+
Total files: 4
|
|
19
|
+
|
|
20
|
+
================================================================================
|
|
21
|
+
FILE CONTENTS
|
|
22
|
+
================================================================================
|
|
23
|
+
|
|
24
|
+
--------------------------------------------------------------------------------
|
|
25
|
+
FILE: /.txtconfig
|
|
26
|
+
--------------------------------------------------------------------------------
|
|
27
|
+
{
|
|
28
|
+
"maxFileSize": "400KB",
|
|
29
|
+
"splitMethod": "none",
|
|
30
|
+
"splitSize": "5MB",
|
|
31
|
+
"copyToClipboard": true
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
--------------------------------------------------------------------------------
|
|
35
|
+
FILE: /LICENSE
|
|
36
|
+
--------------------------------------------------------------------------------
|
|
37
|
+
MIT License
|
|
38
|
+
|
|
39
|
+
Copyright (c) 2026 Muhammad Saad Amin @SENODROOM
|
|
40
|
+
|
|
41
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
42
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
43
|
+
in the Software without restriction, including without limitation the rights
|
|
44
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
45
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
46
|
+
furnished to do so, subject to the following conditions:
|
|
47
|
+
|
|
48
|
+
The above copyright notice and this permission notice shall be included in all
|
|
49
|
+
copies or substantial portions of the Software.
|
|
50
|
+
|
|
51
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
52
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
53
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
54
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
55
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
56
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
57
|
+
SOFTWARE.
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
--------------------------------------------------------------------------------
|
|
61
|
+
FILE: /package.json
|
|
62
|
+
--------------------------------------------------------------------------------
|
|
63
|
+
{
|
|
64
|
+
"name": "make-folder-txt",
|
|
65
|
+
"version": "2.2.1",
|
|
66
|
+
"description": "Generate a single .txt file containing the full folder structure and file contents of any project, ignoring node_modules and other junk.",
|
|
67
|
+
"main": "bin/make-folder-txt.js",
|
|
68
|
+
"bin": {
|
|
69
|
+
"make-folder-txt": "bin/make-folder-txt.js"
|
|
70
|
+
},
|
|
71
|
+
"scripts": {
|
|
72
|
+
"test": "echo \"No tests yet\" && exit 0"
|
|
73
|
+
},
|
|
74
|
+
"keywords": [
|
|
75
|
+
"folder",
|
|
76
|
+
"dump",
|
|
77
|
+
"project",
|
|
78
|
+
"structure",
|
|
79
|
+
"txt",
|
|
80
|
+
"cli",
|
|
81
|
+
"export"
|
|
82
|
+
],
|
|
83
|
+
"author": "Muhammad Saad Amin",
|
|
84
|
+
"license": "MIT",
|
|
85
|
+
"engines": {
|
|
86
|
+
"node": ">=14.0.0"
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
--------------------------------------------------------------------------------
|
|
92
|
+
FILE: /README.md
|
|
93
|
+
--------------------------------------------------------------------------------
|
|
94
|
+
<div align="center">
|
|
95
|
+
|
|
96
|
+
# 📁 make-folder-txt
|
|
97
|
+
|
|
98
|
+
**Instantly dump your entire project into a single, readable `.txt` file.**
|
|
99
|
+
|
|
100
|
+
[](https://www.npmjs.com/package/make-folder-txt)
|
|
101
|
+
[](https://www.npmjs.com/package/make-folder-txt)
|
|
102
|
+
[](./LICENSE)
|
|
103
|
+
[](https://nodejs.org)
|
|
104
|
+
|
|
105
|
+
Perfect for sharing your codebase with **AI tools**, **teammates**, or **code reviewers** — without zipping files or giving repo access.
|
|
106
|
+
|
|
107
|
+
[Installation](#-installation) · [Usage](#-usage) · [Help](#-get-help) · [Copy to Clipboard](#-copy-to-clipboard) · [Force Include Everything](#-force-include-everything) · [File Size Control](#-file-size-control) · [Output Splitting](#-output-splitting) · [Output Format](#-output-format) · [What Gets Skipped](#-what-gets-skipped) · [Contributing](#-contributing)
|
|
108
|
+
|
|
109
|
+
</div>
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## ✨ Why make-folder-txt?
|
|
114
|
+
|
|
115
|
+
Ever needed to share your entire project with ChatGPT, Claude, or a teammate — but copy-pasting every file one by one is painful? **make-folder-txt** solves that in one command.
|
|
116
|
+
|
|
117
|
+
- ✅ Run it from any project directory — no arguments needed
|
|
118
|
+
- ✅ Built-in help system with `--help` flag
|
|
119
|
+
- ✅ File size control with `--skip-large` and `--no-skip`
|
|
120
|
+
- ✅ Output splitting by folders, files, or size
|
|
121
|
+
- ✅ Copy to clipboard with `--copy` flag
|
|
122
|
+
- ✅ Force include everything with `--force` flag
|
|
123
|
+
- ✅ Generates a clean folder tree + every file's content
|
|
124
|
+
- ✅ `.txtignore` support (works like `.gitignore`)
|
|
125
|
+
- ✅ Automatically skips `node_modules`, binaries, and junk files
|
|
126
|
+
- ✅ Zero dependencies — pure Node.js
|
|
127
|
+
- ✅ Works on Windows, macOS, and Linux
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## 📦 Installation
|
|
132
|
+
|
|
133
|
+
Install globally once, use anywhere:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
npm install -g make-folder-txt
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## 🚀 Usage
|
|
142
|
+
|
|
143
|
+
Navigate into your project folder and run:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
cd my-project
|
|
147
|
+
make-folder-txt
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
That's it. A `my-project.txt` file will be created in the same directory.
|
|
151
|
+
|
|
152
|
+
### 📖 Get Help
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
make-folder-txt --help # Show all options and examples
|
|
156
|
+
make-folder-txt -h # Short version of help
|
|
157
|
+
make-folder-txt --version # Show version info
|
|
158
|
+
make-folder-txt -v # Short version of version
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### 📋 Copy to Clipboard
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
make-folder-txt --copy # Generate output and copy to clipboard
|
|
165
|
+
make-folder-txt --copy --ignore-folder node_modules # Copy filtered output
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
The `--copy` flag automatically copies the generated output to your system clipboard, making it easy to paste directly into AI tools, emails, or documents. Works on Windows, macOS, and Linux (requires `xclip` or `xsel` on Linux).
|
|
169
|
+
|
|
170
|
+
### 🔥 Force Include Everything
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
make-folder-txt --force # Include everything (overrides all ignore patterns)
|
|
174
|
+
make-folder-txt --force --copy # Include everything and copy to clipboard
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
The `--force` flag overrides all ignore patterns and includes:
|
|
178
|
+
- `node_modules` and other ignored folders
|
|
179
|
+
- Binary files (images, executables, etc.)
|
|
180
|
+
- Large files (no 500 KB limit)
|
|
181
|
+
- Files in `.txtignore`
|
|
182
|
+
- System files and other normally skipped content
|
|
183
|
+
|
|
184
|
+
Use this when you need a complete, unfiltered dump of your entire project.
|
|
185
|
+
|
|
186
|
+
### 📏 File Size Control
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
make-folder-txt --skip-large 400KB # Skip files larger than 400KB
|
|
190
|
+
make-folder-txt --skip-large 5GB # Skip files larger than 5GB
|
|
191
|
+
make-folder-txt --skip-large 1.5MB # Skip files larger than 1.5MB
|
|
192
|
+
make-folder-txt --no-skip # Include all files regardless of size
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
**Default behavior**: Files larger than 500KB are skipped by default.
|
|
196
|
+
|
|
197
|
+
**Supported size units**:
|
|
198
|
+
- **B** - Bytes
|
|
199
|
+
- **KB** - Kilobytes (1024 bytes)
|
|
200
|
+
- **MB** - Megabytes (1024 KB)
|
|
201
|
+
- **GB** - Gigabytes (1024 MB)
|
|
202
|
+
- **TB** - Terabytes (1024 GB)
|
|
203
|
+
|
|
204
|
+
**Examples:**
|
|
205
|
+
```bash
|
|
206
|
+
# More restrictive - skip anything over 100KB
|
|
207
|
+
make-folder-txt --skip-large 100KB
|
|
208
|
+
|
|
209
|
+
# More permissive - allow files up to 10MB
|
|
210
|
+
make-folder-txt --skip-large 10MB
|
|
211
|
+
|
|
212
|
+
# Include everything - no size limits
|
|
213
|
+
make-folder-txt --no-skip
|
|
214
|
+
|
|
215
|
+
# Combine with other options
|
|
216
|
+
make-folder-txt --skip-large 2MB --ignore-folder node_modules
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
**Size format**: Accepts decimal numbers (e.g., `1.5MB`, `0.5GB`) and various units.
|
|
220
|
+
|
|
221
|
+
### 📂 Output Splitting
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
make-folder-txt --split-method folder # Split by folders
|
|
225
|
+
make-folder-txt --split-method file # Split by files
|
|
226
|
+
make-folder-txt --split-method size --split-size 5MB # Split by file size
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
**Split Methods:**
|
|
230
|
+
- **`folder`** - Creates separate files for each folder
|
|
231
|
+
- **`file`** - Creates separate files for each individual file
|
|
232
|
+
- **`size`** - Splits output when content exceeds specified size
|
|
233
|
+
|
|
234
|
+
**Examples:**
|
|
235
|
+
```bash
|
|
236
|
+
# Split by folders - creates folder-name.txt for each folder
|
|
237
|
+
make-folder-txt --split-method folder
|
|
238
|
+
|
|
239
|
+
# Split by files - creates filename.txt for each file
|
|
240
|
+
make-folder-txt --split-method file
|
|
241
|
+
|
|
242
|
+
# Split by size - creates part-1.txt, part-2.txt, etc.
|
|
243
|
+
make-folder-txt --split-method size --split-size 5MB
|
|
244
|
+
|
|
245
|
+
# Combine with other options
|
|
246
|
+
make-folder-txt --split-method size --split-size 2MB --ignore-folder node_modules
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
**Output Files:**
|
|
250
|
+
- **Folder method**: `projectname-foldername.txt`
|
|
251
|
+
- **File method**: `projectname-filename.txt`
|
|
252
|
+
- **Size method**: `projectname-part-1.txt`, `projectname-part-2.txt`, etc.
|
|
253
|
+
|
|
254
|
+
**Note**: Splitting is not compatible with `--copy` flag.
|
|
255
|
+
|
|
256
|
+
Ignore specific folders/files by name:
|
|
257
|
+
|
|
258
|
+
```bash
|
|
259
|
+
make-folder-txt --ignore-folder examples extensions docs
|
|
260
|
+
make-folder-txt -ifo examples extensions docs # shorthand
|
|
261
|
+
make-folder-txt --ignore-folder examples extensions "docs and explaination"
|
|
262
|
+
make-folder-txt --ignore-folder examples extensions docs --ignore-file LICENSE
|
|
263
|
+
make-folder-txt --ignore-file .env .env.local secrets.txt
|
|
264
|
+
make-folder-txt -ifi .env .env.local secrets.txt # shorthand
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
Use a `.txtignore` file (works like `.gitignore`):
|
|
268
|
+
|
|
269
|
+
```bash
|
|
270
|
+
# Create a .txtignore file in your project root
|
|
271
|
+
echo "node_modules/" > .txtignore
|
|
272
|
+
echo "*.log" >> .txtignore
|
|
273
|
+
echo ".env" >> .txtignore
|
|
274
|
+
echo "coverage/" >> .txtignore
|
|
275
|
+
|
|
276
|
+
# The tool will automatically read and respect .txtignore patterns
|
|
277
|
+
make-folder-txt
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
The `.txtignore` file supports:
|
|
281
|
+
- File and folder names (one per line)
|
|
282
|
+
- Wildcard patterns (`*.log`, `temp-*`)
|
|
283
|
+
- Comments (lines starting with `#`)
|
|
284
|
+
- Folder patterns with trailing slash (`docs/`)
|
|
285
|
+
|
|
286
|
+
Include only specific folders/files by name (everything else is ignored):
|
|
287
|
+
|
|
288
|
+
```bash
|
|
289
|
+
make-folder-txt --only-folder src docs
|
|
290
|
+
make-folder-txt -ofo src docs # shorthand
|
|
291
|
+
make-folder-txt --only-file package.json README.md
|
|
292
|
+
make-folder-txt -ofi package.json README.md # shorthand
|
|
293
|
+
make-folder-txt --only-folder src --only-file package.json
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
---
|
|
297
|
+
|
|
298
|
+
## 🎯 Real World Examples
|
|
299
|
+
|
|
300
|
+
**Sharing with an AI tool (ChatGPT, Claude, etc.):**
|
|
301
|
+
|
|
302
|
+
```bash
|
|
303
|
+
cd "C:\Web Development\my-app\backend"
|
|
304
|
+
make-folder-txt
|
|
305
|
+
# → backend.txt created, ready to paste into any AI chat
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
**On macOS / Linux:**
|
|
309
|
+
|
|
310
|
+
```bash
|
|
311
|
+
cd /home/user/projects/my-app
|
|
312
|
+
make-folder-txt
|
|
313
|
+
# → my-app.txt created
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
---
|
|
317
|
+
|
|
318
|
+
## 📄 Output Format
|
|
319
|
+
|
|
320
|
+
The generated `.txt` file is structured in two clear sections:
|
|
321
|
+
|
|
322
|
+
```
|
|
323
|
+
================================================================================
|
|
324
|
+
START OF FOLDER: my-project
|
|
325
|
+
================================================================================
|
|
326
|
+
|
|
327
|
+
================================================================================
|
|
328
|
+
PROJECT STRUCTURE
|
|
329
|
+
================================================================================
|
|
330
|
+
Root: C:\Web Development\my-project
|
|
331
|
+
|
|
332
|
+
my-project/
|
|
333
|
+
├── src/
|
|
334
|
+
│ ├── controllers/
|
|
335
|
+
│ │ └── userController.js
|
|
336
|
+
│ ├── models/
|
|
337
|
+
│ │ └── User.js
|
|
338
|
+
│ └── index.js
|
|
339
|
+
├── node_modules/ [skipped]
|
|
340
|
+
├── package.json
|
|
341
|
+
└── README.md
|
|
342
|
+
|
|
343
|
+
Total files: 5
|
|
344
|
+
|
|
345
|
+
================================================================================
|
|
346
|
+
FILE CONTENTS
|
|
347
|
+
================================================================================
|
|
348
|
+
|
|
349
|
+
--------------------------------------------------------------------------------
|
|
350
|
+
FILE: /src/index.js
|
|
351
|
+
--------------------------------------------------------------------------------
|
|
352
|
+
const express = require('express');
|
|
353
|
+
...
|
|
354
|
+
|
|
355
|
+
--------------------------------------------------------------------------------
|
|
356
|
+
FILE: /package.json
|
|
357
|
+
--------------------------------------------------------------------------------
|
|
358
|
+
{
|
|
359
|
+
"name": "my-project",
|
|
360
|
+
...
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
================================================================================
|
|
364
|
+
END OF FOLDER: my-project
|
|
365
|
+
================================================================================
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
---
|
|
369
|
+
|
|
370
|
+
## 🚫 What Gets Skipped
|
|
371
|
+
|
|
372
|
+
The tool is smart about what it ignores so your output stays clean and readable.
|
|
373
|
+
|
|
374
|
+
| Category | Details |
|
|
375
|
+
| --------------- | -------------------------------------------------------------- |
|
|
376
|
+
| 📁 Folders | `node_modules`, `.git`, `.next`, `dist`, `build`, `.cache` |
|
|
377
|
+
| 🖼️ Binary files | Images (`.png`, `.jpg`, `.gif`...), fonts, videos, executables |
|
|
378
|
+
| 📦 Archives | `.zip`, `.tar`, `.gz`, `.rar`, `.7z` |
|
|
379
|
+
| 🔤 Font files | `.woff`, `.woff2`, `.ttf`, `.eot`, `.otf` |
|
|
380
|
+
| 📋 Lock files | `package-lock.json`, `yarn.lock` |
|
|
381
|
+
| 📏 Large files | Any file over **500 KB** |
|
|
382
|
+
| 🗑️ System files | `.DS_Store`, `Thumbs.db`, `desktop.ini` |
|
|
383
|
+
| 📄 Output file | The generated `foldername.txt` file (to avoid infinite loops) |
|
|
384
|
+
| 📝 .txtignore | Any files/folders specified in `.txtignore` file |
|
|
385
|
+
|
|
386
|
+
Binary and skipped files are noted in the output as `[binary / skipped]` so you always know what was omitted.
|
|
387
|
+
|
|
388
|
+
---
|
|
389
|
+
|
|
390
|
+
## 🛠️ Requirements
|
|
391
|
+
|
|
392
|
+
- **Node.js** v14.0.0 or higher
|
|
393
|
+
- No other dependencies
|
|
394
|
+
|
|
395
|
+
---
|
|
396
|
+
|
|
397
|
+
## 🤝 Contributing
|
|
398
|
+
|
|
399
|
+
Contributions, issues, and feature requests are welcome!
|
|
400
|
+
|
|
401
|
+
1. Fork the repository
|
|
402
|
+
2. Create your feature branch: `git checkout -b feature/my-feature`
|
|
403
|
+
3. Commit your changes: `git commit -m 'Add my feature'`
|
|
404
|
+
4. Push to the branch: `git push origin feature/my-feature`
|
|
405
|
+
5. Open a Pull Request
|
|
406
|
+
|
|
407
|
+
---
|
|
408
|
+
|
|
409
|
+
## 👤 Author
|
|
410
|
+
|
|
411
|
+
**Muhammad Saad Amin**
|
|
412
|
+
|
|
413
|
+
---
|
|
414
|
+
|
|
415
|
+
## 📝 License
|
|
416
|
+
|
|
417
|
+
This project is licensed under the **MIT License** — feel free to use it in personal and commercial projects.
|
|
418
|
+
|
|
419
|
+
---
|
|
420
|
+
|
|
421
|
+
<div align="center">
|
|
422
|
+
|
|
423
|
+
If this tool saved you time, consider giving it a ⭐ on npm!
|
|
424
|
+
|
|
425
|
+
</div>
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
================================================================================
|
|
429
|
+
END OF FOLDER: make-folder-txt
|
|
430
|
+
================================================================================
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "make-folder-txt",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.2",
|
|
4
4
|
"description": "Generate a single .txt file containing the full folder structure and file contents of any project, ignoring node_modules and other junk.",
|
|
5
5
|
"main": "bin/make-folder-txt.js",
|
|
6
6
|
"bin": {
|