UNPKG

structure-maker

Version:

Generate a folder structure with tech-specific icons

148 lines (108 loc) • 4.12 kB
# structure-maker [![npm version](https://img.shields.io/npm/v/structure-maker.svg)](https://www.npmjs.com/package/structure-maker) [![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](https://opensource.org/licenses/ISC) > Keywords: `directory-tree`, `folder-structure`, `file-explorer`, `project-visualization`, `markdown-generator`, `documentation-tool`, `dev-utility`, `file-system-scanner` Generate beautiful folder structure visualizations with tech-specific icons for documentation, sharing, or analysis. ![Structure Maker Example](https://via.placeholder.com/650x350?text=Structure+Maker+Example) ## Features - šŸ“ Creates clear, readable folder structure visualizations - šŸ–¼ļø Tech-specific icons for different file types - šŸ“Š Summary statistics of files and folders - āš™ļø Customizable depth and ignore patterns - šŸ’¾ Saves output as a Markdown file - šŸŽØ Colorized terminal output ## Installation ### Global Installation (Recommended) ```bash npm install -g structure-maker ``` ### Local Installation ```bash npm install structure-maker ``` ## Usage Navigate to the directory you want to visualize and run: ```bash structure-maker ``` This will: 1. Generate a tree visualization of your current directory 2. Create a `folder-structure.md` file with detailed documentation 3. Display a colorized version of the tree in your terminal ### Command Line Options | Option | Description | |--------|-------------| | `--depth` | Maximum depth to traverse (default: infinite) | | `--ignore` | Comma-separated patterns to ignore | ### Examples **Limit directory depth:** ```bash structure-maker --depth 2 ``` **Ignore specific folders or files:** ```bash structure-maker --ignore dist,build,temp ``` **Combine options:** ```bash structure-maker --depth 3 --ignore logs,temp ``` ## Output Example The tool generates a Markdown file (`folder-structure.md`) with: - Directory statistics (files and folders count) - Breakdown of file types - Complete directory tree with file sizes Example terminal output: ``` project-root/ ā”œā”€ šŸ“ src │ ā”œā”€ šŸ“ components │ │ ā”œā”€ šŸ’» Button.js (2.3 KB) │ │ └─ šŸ’» Header.js (1.7 KB) │ └─ šŸ’» index.js (0.5 KB) ā”œā”€ šŸ“ docs │ └─ šŸ“œ README.md (3.2 KB) └─ šŸ“Š package.json (1.1 KB) ``` ## File Type Icons | Extension | Icon | Description | |-----------|------|-------------| | `.js`, `.ts`, `.py`, `.java` | šŸ’» | Code files | | `.md`, `.txt` | šŸ“œ | Text documents | | `.json` | šŸ“Š | Data files | | `.jpg`, `.png`, `.gif` | šŸ–¼ļø | Image files | | `.mp4`, `.avi` | šŸŽ„ | Video files | | `.mp3`, `.wav` | šŸŽµ | Audio files | | `.pdf`, `.docx` | šŸ“š | Document files | | Other | šŸ“„ | Generic files | ## Contributing Contributions are welcome and appreciated! Here's how you can contribute: ### Bug Reports & Feature Requests - Use the GitHub Issues tab to report bugs or suggest features - Clearly describe the issue including steps to reproduce when it is a bug - Make sure to include your environment details (OS, Node.js version) ### Development Process 1. Fork the repository 2. Create your feature branch (`git checkout -b feature/amazing-feature`) 3. Make your changes 4. Run tests if available 5. Commit your changes (`git commit -m 'Add some amazing feature'`) 6. Push to the branch (`git push origin feature/amazing-feature`) 7. Open a Pull Request ### Ideas for Contributions - Add more file type icons - Improve the markdown output formatting - Add export options for different formats (JSON, HTML, etc.) - Create a web UI version - Add stats visualization - Improve performance for large directories ### Code Style - Maintain the existing code style - Add comments for complex logic - Update documentation as needed ## License This project is licensed under the ISC License - see the LICENSE file for details. ## Author Chauhan Yuvraj --- Made with ā¤ļø for developers who love clean documentation