treefiy
Version:
Tool for visualizing folder structure
102 lines (84 loc) β’ 3.26 kB
Markdown
# Treefiy π³
[](LICENSE)
[](https://npmjs.com/package/treefiy)
[](https://fastify.io)
A lightweight, pluggable CLI and API tool for directory structure visualization and analysis.
## π Table of Contents
- [Features](#-features)
- [Installation](#-installation)
- [Usage](#-usage)
- [Project Structure](#-project-structure)
- [Architecture](#-architecture)
- [API Documentation](#-api-documentation)
- [License](#-license)
## π Features
- π **Multi-format Visualization**: Generate trees in JSON
- β‘ **High Performance**: Optimized directory traversal algorithms
- π’ **CLI Commands**: Interactive commands
- π **File Metadata**: Display size, permissions, and modification dates
- π **Web UI**: Browser-based visualization with React
- π‘ **REST API**: Integration-ready HTTP endpoints
## π₯ Installation
### Local Development (Contributors)
```bash
git clone https://github.com/zyadamr-dev/treefiy.git
cd treefiy
npm install
npm link # Creates global symlink
```
### Global install (Users)
```bash
npm install -g treefiy
```
## π’ Usage
```bash
treefiy <command> [options]
```
### Example
```bash
treefiy gen-tree --pth=D:/projects --showSize=true --skipDirs=node_modules
```
- For more info about how to use it you can excute command
```bash
treefiy help
```
## ποΈ Project Structure
```bash
βββ src/
β βββ .config/ # App configuration & logging
β β βββ cached-config/ # Cached user configs
β β βββ cliStyleConfig.js # CLI tree style formatting
β β βββ defaultConfig.js # Default settings
β β βββ logger.js # Logger setup
β βββ api/ # Fastify API server
β β βββ functions.js # Tree generation logic
β β βββ server.js # Fastify application
β βββ cli/ # CLI command dispatcher
β β βββ commands/ # Individual command modules
β β βββ index.js # Main CLI entry point
β βββ constants/ # Shared constants (e.g., aliases)
β β βββ cmdAlias.js
β β βββ outFormat.js
β βββ core/ # Core functionality
β β βββ index.js # Visualizer class & tree logic
β β βββ ui/ # React frontend for visualization
β βββ utils/ # Utility modules (spinner, config parser)
β βββ spinner.js
β βββ parseConfig.js
β βββ index.js
βββ LICENSE
βββ package.json
```
## βοΈ Architecture

## β¨ API Documentation
### Endpoints
- GET api/tree?pth=[dir]&showSize=true - Generate directory structure
- GET api/config - View active configuration
## πͺͺ License
MIT Β© 2025 β Zyad A.