1.1.1 • Published 10 months ago

fileweaver v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

šŸ“ FileWeaver

Version Downloads License Node

A powerful CLI tool for weaving files together with advanced pattern matching capabilities, featuring visual progress and tree view of processed files.

Installation • Usage • Examples • Contributing

✨ Features

  • šŸ” Regex Pattern Matching: Filter files using regular expressions
  • 🚫 Exclusion Patterns: Ignore files that match specific patterns
  • šŸ“‚ Directory Support: Process files from any directory
  • šŸ“‘ File Headers: Option to include original filenames in the output
  • šŸŽÆ Flexible Output: Specify custom output location and filename
  • 🌳 Tree View: Visual representation of processed files with optional inclusion in output
  • šŸ“Š Progress Bar: Real-time processing visualization
  • šŸŽØ Colored Output: Enhanced readability with color-coded messages
  • šŸ“ Custom Prompts: Add custom prompts to the output file
  • šŸ—‚ļø Directory Tree: Include directory structure in the output file

šŸš€ Installation

npm install -g fileweaver

šŸ”§ Usage

fileweaver [options]

Options

OptionDescriptionDefault
-r, --regex <pattern>Regex pattern to match files-
-ir, --ignoreregex <pattern>Regex pattern to ignore files-
-d, --directory <path>Directory pathCurrent directory
-h, --headersAdd file headers to contentfalse
-o, --output <file>Output file nameoutput.txt
-t, --treeInclude directory tree in output filefalse
-p, --prompt <text>Add custom prompt to output file-
--versionShow version number-
--helpShow help-

šŸ“‹ Examples

Basic File Concatenation with Tree

fileweaver -d . -r "\.js$" -t true -o combined.js

This will include a tree view in the output file:

==================================================
Directory Tree:
==================================================
ā”œā”€ā”€ src
│   ā”œā”€ā”€ index.js
│   └── utils
│       ā”œā”€ā”€ helper.js
│       └── validator.js
└── index.js

Add Custom Prompt

fileweaver -r "\.md$" -p "Process these markdown files for documentation" -o docs.md

Output will include:

==================================================
Prompt:
==================================================
Process these markdown files for documentation

Combine Multiple Features

fileweaver -d ./src -r "\.(js|ts)$" -h true -t true -p "Review this code" -o bundle.js

This will:

  • Process all .js and .ts files
  • Add headers for each file
  • Include the directory tree
  • Add the specified prompt
  • Save everything to bundle.js

Process Multiple File Types

fileweaver -d ./src -r "\.(js|ts)$" -h true -o bundle.js

Output tree:

Files to be processed:
└── src
    ā”œā”€ā”€ components
    │   ā”œā”€ā”€ Button.ts
    │   └── Input.js
    └── utils
        ā”œā”€ā”€ helpers.js
        └── types.ts

Exclude Multiple Patterns

fileweaver -d . -r "\.js$" -ir "node_modules|dist|test" -o prod.js

Tree view:

Files to be processed:
ā”œā”€ā”€ src
│   ā”œā”€ā”€ main.js
│   └── config.js
└── index.js

With Headers in Output

The -h flag adds file headers to the output:

==================================================
File: src/main.js
==================================================
// Main file content here...

==================================================
File: src/config.js
==================================================
// Config file content here...

šŸ” Advanced Usage

Nested Directories with Tree and Prompt

Process files in nested directories, include tree structure, and add a processing prompt:

fileweaver -d ./project -r "\.css$" -ir "vendor|temp" -t true -p "Combine all CSS files" -o styles.css

Complex Pattern Matching with Custom Output

fileweaver -r "\.(html|ejs)$" -ir "temp_|draft_" -h true -t true -o templates.html

šŸ¤ Contributing

Contributions are welcome! Feel free to:

  1. Fork the repository
  2. Create your feature branch: git checkout -b feature/amazing-feature
  3. Commit your changes: git commit -m 'Add amazing feature'
  4. Push to the branch: git push origin feature/amazing-feature
  5. Open a Pull Request

šŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

šŸ›Ÿ Support

For support and questions, please open an issue on GitHub.


1.1.1

10 months ago

1.1.0

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago

0.0.1-dev

10 months ago