make-folder-txt 2.2.5 → 2.2.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.
@@ -1061,7 +1061,12 @@ Dump an entire project folder into a single readable .txt file.
1061
1061
  ignoreFiles,
1062
1062
  onlyFolders,
1063
1063
  onlyFiles,
1064
- { rootName, txtIgnore, force: forceFlag }
1064
+ {
1065
+ rootName,
1066
+ txtIgnore,
1067
+ force: forceFlag,
1068
+ hasOnlyFilters: onlyFolders.size > 0 || onlyFiles.size > 0
1069
+ }
1065
1070
  );
1066
1071
 
1067
1072
  // ── build output filename ───────────────────────────────────────────────────────────
@@ -8,14 +8,11 @@ PROJECT STRUCTURE
8
8
  Root: C:\Programming\make-folder-txt
9
9
 
10
10
  make-folder-txt/
11
- ├── .git/ [skipped]
12
11
  ├── bin/
13
12
  │ └── make-folder-txt.js
14
- ├── LICENSE
15
13
  ├── package.json
16
- └── README.md
17
14
 
18
- Total files: 4
15
+ Total files: 2
19
16
 
20
17
  ================================================================================
21
18
  FILE CONTENTS
@@ -1087,7 +1084,12 @@ Dump an entire project folder into a single readable .txt file.
1087
1084
  ignoreFiles,
1088
1085
  onlyFolders,
1089
1086
  onlyFiles,
1090
- { rootName, txtIgnore, force: forceFlag }
1087
+ {
1088
+ rootName,
1089
+ txtIgnore,
1090
+ force: forceFlag,
1091
+ hasOnlyFilters: onlyFolders.size > 0 || onlyFiles.size > 0
1092
+ }
1091
1093
  );
1092
1094
 
1093
1095
  // ── build output filename ───────────────────────────────────────────────────────────
@@ -1199,38 +1201,12 @@ main().catch(err => {
1199
1201
  });
1200
1202
 
1201
1203
 
1202
- --------------------------------------------------------------------------------
1203
- FILE: /LICENSE
1204
- --------------------------------------------------------------------------------
1205
- MIT License
1206
-
1207
- Copyright (c) 2026 Muhammad Saad Amin @SENODROOM
1208
-
1209
- Permission is hereby granted, free of charge, to any person obtaining a copy
1210
- of this software and associated documentation files (the "Software"), to deal
1211
- in the Software without restriction, including without limitation the rights
1212
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1213
- copies of the Software, and to permit persons to whom the Software is
1214
- furnished to do so, subject to the following conditions:
1215
-
1216
- The above copyright notice and this permission notice shall be included in all
1217
- copies or substantial portions of the Software.
1218
-
1219
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1220
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1221
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1222
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1223
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1224
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1225
- SOFTWARE.
1226
-
1227
-
1228
1204
  --------------------------------------------------------------------------------
1229
1205
  FILE: /package.json
1230
1206
  --------------------------------------------------------------------------------
1231
1207
  {
1232
1208
  "name": "make-folder-txt",
1233
- "version": "2.2.4",
1209
+ "version": "2.2.5",
1234
1210
  "description": "Generate a single .txt file containing the full folder structure and file contents of any project, ignoring node_modules and other junk.",
1235
1211
  "main": "bin/make-folder-txt.js",
1236
1212
  "bin": {
@@ -1256,343 +1232,6 @@ FILE: /package.json
1256
1232
  }
1257
1233
 
1258
1234
 
1259
- --------------------------------------------------------------------------------
1260
- FILE: /README.md
1261
- --------------------------------------------------------------------------------
1262
- <div align="center">
1263
-
1264
- # 📁 make-folder-txt
1265
-
1266
- **Instantly dump your entire project into a single, readable `.txt` file.**
1267
-
1268
- [![npm version](https://img.shields.io/npm/v/make-folder-txt?color=crimson&style=flat-square)](https://www.npmjs.com/package/make-folder-txt)
1269
- [![npm downloads](https://img.shields.io/npm/dm/make-folder-txt?color=orange&style=flat-square)](https://www.npmjs.com/package/make-folder-txt)
1270
- [![license](https://img.shields.io/npm/l/make-folder-txt?color=blue&style=flat-square)](./LICENSE)
1271
- [![node](https://img.shields.io/node/v/make-folder-txt?color=green&style=flat-square)](https://nodejs.org)
1272
-
1273
- Perfect for sharing your codebase with **AI tools**, **teammates**, or **code reviewers** — without zipping files or giving repo access.
1274
-
1275
- [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)
1276
-
1277
- </div>
1278
-
1279
- ---
1280
-
1281
- ## ✨ Why make-folder-txt?
1282
-
1283
- 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.
1284
-
1285
- - ✅ Run it from any project directory — no arguments needed
1286
- - ✅ Built-in help system with `--help` flag
1287
- - ✅ File size control with `--skip-large` and `--no-skip`
1288
- - ✅ Output splitting by folders, files, or size
1289
- - ✅ Copy to clipboard with `--copy` flag
1290
- - ✅ Force include everything with `--force` flag
1291
- - ✅ Generates a clean folder tree + every file's content
1292
- - ✅ `.txtignore` support (works like `.gitignore`)
1293
- - ✅ Automatically skips `node_modules`, binaries, and junk files
1294
- - ✅ Zero dependencies — pure Node.js
1295
- - ✅ Works on Windows, macOS, and Linux
1296
-
1297
- ---
1298
-
1299
- ## 📦 Installation
1300
-
1301
- Install globally once, use anywhere:
1302
-
1303
- ```bash
1304
- npm install -g make-folder-txt
1305
- ```
1306
-
1307
- ---
1308
-
1309
- ## 🚀 Usage
1310
-
1311
- Navigate into your project folder and run:
1312
-
1313
- ```bash
1314
- cd my-project
1315
- make-folder-txt
1316
- ```
1317
-
1318
- That's it. A `my-project.txt` file will be created in the same directory.
1319
-
1320
- ### 📖 Get Help
1321
-
1322
- ```bash
1323
- make-folder-txt --help # Show all options and examples
1324
- make-folder-txt -h # Short version of help
1325
- make-folder-txt --version # Show version info
1326
- make-folder-txt -v # Short version of version
1327
- ```
1328
-
1329
- ### 📋 Copy to Clipboard
1330
-
1331
- ```bash
1332
- make-folder-txt --copy # Generate output and copy to clipboard
1333
- make-folder-txt --copy --ignore-folder node_modules # Copy filtered output
1334
- ```
1335
-
1336
- 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).
1337
-
1338
- ### 🔥 Force Include Everything
1339
-
1340
- ```bash
1341
- make-folder-txt --force # Include everything (overrides all ignore patterns)
1342
- make-folder-txt --force --copy # Include everything and copy to clipboard
1343
- ```
1344
-
1345
- The `--force` flag overrides all ignore patterns and includes:
1346
- - `node_modules` and other ignored folders
1347
- - Binary files (images, executables, etc.)
1348
- - Large files (no 500 KB limit)
1349
- - Files in `.txtignore`
1350
- - System files and other normally skipped content
1351
-
1352
- Use this when you need a complete, unfiltered dump of your entire project.
1353
-
1354
- ### 📏 File Size Control
1355
-
1356
- ```bash
1357
- make-folder-txt --skip-large 400KB # Skip files larger than 400KB
1358
- make-folder-txt --skip-large 5GB # Skip files larger than 5GB
1359
- make-folder-txt --skip-large 1.5MB # Skip files larger than 1.5MB
1360
- make-folder-txt --no-skip # Include all files regardless of size
1361
- ```
1362
-
1363
- **Default behavior**: Files larger than 500KB are skipped by default.
1364
-
1365
- **Supported size units**:
1366
- - **B** - Bytes
1367
- - **KB** - Kilobytes (1024 bytes)
1368
- - **MB** - Megabytes (1024 KB)
1369
- - **GB** - Gigabytes (1024 MB)
1370
- - **TB** - Terabytes (1024 GB)
1371
-
1372
- **Examples:**
1373
- ```bash
1374
- # More restrictive - skip anything over 100KB
1375
- make-folder-txt --skip-large 100KB
1376
-
1377
- # More permissive - allow files up to 10MB
1378
- make-folder-txt --skip-large 10MB
1379
-
1380
- # Include everything - no size limits
1381
- make-folder-txt --no-skip
1382
-
1383
- # Combine with other options
1384
- make-folder-txt --skip-large 2MB --ignore-folder node_modules
1385
- ```
1386
-
1387
- **Size format**: Accepts decimal numbers (e.g., `1.5MB`, `0.5GB`) and various units.
1388
-
1389
- ### 📂 Output Splitting
1390
-
1391
- ```bash
1392
- make-folder-txt --split-method folder # Split by folders
1393
- make-folder-txt --split-method file # Split by files
1394
- make-folder-txt --split-method size --split-size 5MB # Split by file size
1395
- ```
1396
-
1397
- **Split Methods:**
1398
- - **`folder`** - Creates separate files for each folder
1399
- - **`file`** - Creates separate files for each individual file
1400
- - **`size`** - Splits output when content exceeds specified size
1401
-
1402
- **Examples:**
1403
- ```bash
1404
- # Split by folders - creates folder-name.txt for each folder
1405
- make-folder-txt --split-method folder
1406
-
1407
- # Split by files - creates filename.txt for each file
1408
- make-folder-txt --split-method file
1409
-
1410
- # Split by size - creates part-1.txt, part-2.txt, etc.
1411
- make-folder-txt --split-method size --split-size 5MB
1412
-
1413
- # Combine with other options
1414
- make-folder-txt --split-method size --split-size 2MB --ignore-folder node_modules
1415
- ```
1416
-
1417
- **Output Files:**
1418
- - **Folder method**: `projectname-foldername.txt`
1419
- - **File method**: `projectname-filename.txt`
1420
- - **Size method**: `projectname-part-1.txt`, `projectname-part-2.txt`, etc.
1421
-
1422
- **Note**: Splitting is not compatible with `--copy` flag.
1423
-
1424
- Ignore specific folders/files by name:
1425
-
1426
- ```bash
1427
- make-folder-txt --ignore-folder examples extensions docs
1428
- make-folder-txt -ifo examples extensions docs # shorthand
1429
- make-folder-txt --ignore-folder examples extensions "docs and explaination"
1430
- make-folder-txt --ignore-folder examples extensions docs --ignore-file LICENSE
1431
- make-folder-txt --ignore-file .env .env.local secrets.txt
1432
- make-folder-txt -ifi .env .env.local secrets.txt # shorthand
1433
- ```
1434
-
1435
- Use a `.txtignore` file (works like `.gitignore`):
1436
-
1437
- ```bash
1438
- # Create a .txtignore file in your project root
1439
- echo "node_modules/" > .txtignore
1440
- echo "*.log" >> .txtignore
1441
- echo ".env" >> .txtignore
1442
- echo "coverage/" >> .txtignore
1443
-
1444
- # The tool will automatically read and respect .txtignore patterns
1445
- make-folder-txt
1446
- ```
1447
-
1448
- The `.txtignore` file supports:
1449
- - File and folder names (one per line)
1450
- - Wildcard patterns (`*.log`, `temp-*`)
1451
- - Comments (lines starting with `#`)
1452
- - Folder patterns with trailing slash (`docs/`)
1453
-
1454
- Include only specific folders/files by name (everything else is ignored):
1455
-
1456
- ```bash
1457
- make-folder-txt --only-folder src docs
1458
- make-folder-txt -ofo src docs # shorthand
1459
- make-folder-txt --only-file package.json README.md
1460
- make-folder-txt -ofi package.json README.md # shorthand
1461
- make-folder-txt --only-folder src --only-file package.json
1462
- ```
1463
-
1464
- ---
1465
-
1466
- ## 🎯 Real World Examples
1467
-
1468
- **Sharing with an AI tool (ChatGPT, Claude, etc.):**
1469
-
1470
- ```bash
1471
- cd "C:\Web Development\my-app\backend"
1472
- make-folder-txt
1473
- # → backend.txt created, ready to paste into any AI chat
1474
- ```
1475
-
1476
- **On macOS / Linux:**
1477
-
1478
- ```bash
1479
- cd /home/user/projects/my-app
1480
- make-folder-txt
1481
- # → my-app.txt created
1482
- ```
1483
-
1484
- ---
1485
-
1486
- ## 📄 Output Format
1487
-
1488
- The generated `.txt` file is structured in two clear sections:
1489
-
1490
- ```
1491
- ================================================================================
1492
- START OF FOLDER: my-project
1493
- ================================================================================
1494
-
1495
- ================================================================================
1496
- PROJECT STRUCTURE
1497
- ================================================================================
1498
- Root: C:\Web Development\my-project
1499
-
1500
- my-project/
1501
- ├── src/
1502
- │ ├── controllers/
1503
- │ │ └── userController.js
1504
- │ ├── models/
1505
- │ │ └── User.js
1506
- │ └── index.js
1507
- ├── node_modules/ [skipped]
1508
- ├── package.json
1509
- └── README.md
1510
-
1511
- Total files: 5
1512
-
1513
- ================================================================================
1514
- FILE CONTENTS
1515
- ================================================================================
1516
-
1517
- --------------------------------------------------------------------------------
1518
- FILE: /src/index.js
1519
- --------------------------------------------------------------------------------
1520
- const express = require('express');
1521
- ...
1522
-
1523
- --------------------------------------------------------------------------------
1524
- FILE: /package.json
1525
- --------------------------------------------------------------------------------
1526
- {
1527
- "name": "my-project",
1528
- ...
1529
- }
1530
-
1531
- ================================================================================
1532
- END OF FOLDER: my-project
1533
- ================================================================================
1534
- ```
1535
-
1536
- ---
1537
-
1538
- ## 🚫 What Gets Skipped
1539
-
1540
- The tool is smart about what it ignores so your output stays clean and readable.
1541
-
1542
- | Category | Details |
1543
- | --------------- | -------------------------------------------------------------- |
1544
- | 📁 Folders | `node_modules`, `.git`, `.next`, `dist`, `build`, `.cache` |
1545
- | 🖼️ Binary files | Images (`.png`, `.jpg`, `.gif`...), fonts, videos, executables |
1546
- | 📦 Archives | `.zip`, `.tar`, `.gz`, `.rar`, `.7z` |
1547
- | 🔤 Font files | `.woff`, `.woff2`, `.ttf`, `.eot`, `.otf` |
1548
- | 📋 Lock files | `package-lock.json`, `yarn.lock` |
1549
- | 📏 Large files | Any file over **500 KB** |
1550
- | 🗑️ System files | `.DS_Store`, `Thumbs.db`, `desktop.ini` |
1551
- | 📄 Output file | The generated `foldername.txt` file (to avoid infinite loops) |
1552
- | 📝 .txtignore | Any files/folders specified in `.txtignore` file |
1553
-
1554
- Binary and skipped files are noted in the output as `[binary / skipped]` so you always know what was omitted.
1555
-
1556
- ---
1557
-
1558
- ## 🛠️ Requirements
1559
-
1560
- - **Node.js** v14.0.0 or higher
1561
- - No other dependencies
1562
-
1563
- ---
1564
-
1565
- ## 🤝 Contributing
1566
-
1567
- Contributions, issues, and feature requests are welcome!
1568
-
1569
- 1. Fork the repository
1570
- 2. Create your feature branch: `git checkout -b feature/my-feature`
1571
- 3. Commit your changes: `git commit -m 'Add my feature'`
1572
- 4. Push to the branch: `git push origin feature/my-feature`
1573
- 5. Open a Pull Request
1574
-
1575
- ---
1576
-
1577
- ## 👤 Author
1578
-
1579
- **Muhammad Saad Amin**
1580
-
1581
- ---
1582
-
1583
- ## 📝 License
1584
-
1585
- This project is licensed under the **MIT License** — feel free to use it in personal and commercial projects.
1586
-
1587
- ---
1588
-
1589
- <div align="center">
1590
-
1591
- If this tool saved you time, consider giving it a ⭐ on npm!
1592
-
1593
- </div>
1594
-
1595
-
1596
1235
  ================================================================================
1597
1236
  END OF FOLDER: make-folder-txt
1598
1237
  ================================================================================
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "make-folder-txt",
3
- "version": "2.2.5",
3
+ "version": "2.2.6",
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": {