Convert local folders contents to a text file with folder2txt
I’m excited to announce the launch of my latest CLI tool, folder2txt—a simple yet powerful utility to convert the contents of local folders into a single text file. Whether you’re working on analysis, documentation, or training AI models, this tool will save you time and effort.
What is folder2txt?
folder2txt is a command-line tool that processes all files within a folder (and its subfolders) and combines their contents into a single text file. It’s designed to handle text files efficiently, automatically exclude binary files, and ignore unnecessary folders (like node_modules, .git, or .lock files). The result? A clean, organized output that’s ready for your use.
Why Use folder2txt?
Manually piecing together file contents can be tedious and error-prone. folder2txt eliminates this hassle by providing a streamlined, automated solution. It’s perfect for:
- Preparing datasets for AI/ML training.
- Consolidating documentation files into a single text file.
- Analysing codebases or project structures.
- Archiving project contents in an easy-to-read format.
With its simple commands and useful options, you can customize how files are processed and included in the output.
Getting Started
You can install folder2txt via npm in just a few seconds:
npm install --global folder2txt
Navigate to any folder you want to convert, and run:
folder2txt
By default, the tool creates a text file named output.txt in the same directory. It processes files recursively while excluding large files, binaries, and unnecessary folders.
Features at a Glance
- ? Process local folders: Handles all text files in a folder and subfolders.
- ? Single text file output: Combines file contents into one structured text file.
- ? Binary file exclusion: Automatically skips non-text files.
- ? Customizable thresholds: Exclude files based on size or include all files with a simple flag.
- ? Cross-platform compatibility: Works seamlessly on Windows, macOS, and Linux.
Get it
Visit the GitHub Repository to explore the source code, report issues, or contribute to the project.
Visit the NPM page to find out more about installing the tool.
Feedback and Support
Have suggestions or found a bug? Feel free to open an issue on GitHub. Your feedback is greatly appreciated!
Start saving time with folder2txt today, and let me know how it works for you. If you find it useful, please give the project a ? on GitHub. Thank you!