folder2txt v1.0.1
folder2txt
Convert local folder contents into a single text file with ease. This CLI tool processes all files in a folder and concatenates their contents into a single text file, making it perfect for analysis, documentation, or AI training purposes.
Features
- π Process files in any local folder
- π Convert folder contents to a single text file
- β‘ Automatic binary file exclusion
- π§ Configurable file size threshold
- π» Cross-platform support (Windows, macOS, Linux)
Installation
Install globally via npm:
npm install --global folder2txt
then navigate to the folder you want to convert to a txt file, and run:
$ folder2txt
Options
--output, -o Specify output file path (default: output.txt)
--threshold, -t Set file size threshold in MB (default: 0.1)
--include-all Include all files regardless of size or type
--debug Enable debug mode with verbose logging
--help Show help
--version Show version
Default Behavior
- Files larger than 100KB are excluded by default
- Binary files are automatically excluded
- The output file is created in the current directory and named output.txt
- Files are processed recursively through all subdirectories (excluding the output fileβs directory, node_modules, vendor, .lock files and .git)
- File paths and contents are separated by clear markers
- Relative paths are preserved in the output
Output Format
The tool generates a text file with this format:
================================================================================
File: path/to/file.txt
Size: 1.2 KB
================================================================================
[File contents here]
================================================================================
File: another/file.js
Size: 4.5 KB
================================================================================
[File contents here]
Install folder2txt
- Using terminal or another CLI, download from npm and install as a global package -
npm install -g folder2txt
- Using terminal or another CLI, navigate to the folder you want to copy in to a text file.
- Run
folder2txt
.
Update folder2txt
To update to the latest version you can just run the install command again - npm install -g folder2txt
Feedback and issues
Please open an issue in the GitHub repo. Thanks.
License
This project is licensed under the MIT License. See the LICENSE file for details.
folder2txt is based on git2txt by Addy Osmani and retains the original MIT License.
Changelog
1.0.1 Adds more ignored files and folders
1.0.0 Initial release