A powerful, feature-rich command-line tool for comprehensive directory analysis
- π Comprehensive Directory Analysis - Get detailed insights into directory structure, file counts, and sizes
- ποΈ Smart File Classification - Automatically categorize files by type (images, videos, documents, audio, code, archives)
- π¨ Large File Detection - Identify files consuming significant disk space
- π Duplicate File Detection - Find and analyze duplicate files to reclaim storage
- π Interactive Mode - Explore directories with an intuitive interactive interface
- π³ Tree View Visualization - Display directory structure in a beautiful tree format
- π HTML Reports - Generate rich HTML reports with charts and visualizations
- π Multiple Export Formats - Export results to JSON, CSV, or HTML
- β‘ Real-time Progress Tracking - Monitor analysis progress with visual progress bars
- π Watch Mode - Monitor directory changes in real-time
- π― Advanced Filtering - Filter files by size, date, patterns, and more
- βοΈ Configurable - Customize analysis with configuration files
- π High Performance - Optimized for speed and memory efficiency
- π Cross-platform - Works on Windows, macOS, and Linux
npm install -g dir-analysis-tool
npm install dir-analysis-tool
Analyze current directory:
dir-analysis-tool
Analyze specific directory:
dir-analysis-tool /path/to/directory
dir-analysis-tool [directory] [options]
-p, --path <path>
- Target directory to analyze (default: current directory)-r, --recursive
- Recursively analyze nested directories (default: true)--no-recursive
- Disable recursive analysis-j, --json
- Output results in JSON format-t, --types
- Show file type classification summary (default: true)--no-types
- Hide file type classification
-l, --large-files [threshold]
- Detect large files (default: 100MB)-d, --duplicates
- Enable duplicate file detection--empty-files
- Detect and show empty files--top-n <number>
- Show top N largest files (default: 10)--tree
- Display results in tree view format
-e, --exclude <patterns...>
- Exclude file patterns or directories--max-depth <depth>
- Maximum directory depth to scan--min-size <size>
- Filter files by minimum size (bytes)--max-size <size>
- Filter files by maximum size (bytes)--date-from <date>
- Filter files modified after this date (YYYY-MM-DD)--date-to <date>
- Filter files modified before this date (YYYY-MM-DD)
--csv [filename]
- Export results to CSV file--csv-large [filename]
- Export large files to CSV--csv-duplicates [filename]
- Export duplicates to CSV--html [filename]
- Generate HTML report with charts
-i, --interactive
- Start interactive mode-w, --watch
- Watch mode - monitor directory changes--progress
- Show progress bar during analysis (default: true)--no-progress
- Disable progress bar
-c, --config [path]
- Load configuration from file
# Analyze current directory with file type classification
dir-analysis-tool
# Analyze specific directory
dir-analysis-tool ~/Documents
# Get JSON output
dir-analysis-tool --json ~/Downloads
# Find large files over 50MB and duplicates
dir-analysis-tool --large-files 52428800 --duplicates ~/Pictures
# Show tree view with top 20 largest files
dir-analysis-tool --tree --top-n 20 /var/log
# Analyze with filters
dir-analysis-tool --min-size 1048576 --max-depth 3 --exclude "*.tmp" "cache*"
# Generate HTML report
dir-analysis-tool --html report.html ~/Projects
# Export to CSV files
dir-analysis-tool --csv analysis.csv --csv-large large-files.csv --duplicates
# Export duplicates analysis
dir-analysis-tool --duplicates --csv-duplicates duplicates.csv
# Start interactive explorer
dir-analysis-tool --interactive
# Watch directory for changes
dir-analysis-tool --watch ~/Downloads
Launch interactive mode for a guided analysis experience:
dir-analysis-tool -i
Interactive mode features:
- π Guided Analysis - Step-by-step directory analysis
- π Directory Navigation - Easy directory switching
- π Multiple Views - Switch between different result views
- πΎ Export Options - Export results in various formats
- βοΈ Advanced Settings - Configure analysis options
- π Directory Comparison - Compare multiple directories
Create a configuration file to customize default behavior:
{
"excludePatterns": ["node_modules", ".git", "*.tmp"],
"largeSizeThreshold": 104857600,
"enableDuplicateDetection": false,
"enableProgressBar": true,
"outputFormat": "table",
"maxDepth": -1,
"topN": 10,
"showEmptyFiles": false
}
The tool automatically searches for configuration files in the current directory and parent directories.
Rich, colorized console output with:
- π Directory summary
- π File type breakdown
- π¨ Large files list
- π Duplicate file groups
- π³ Tree view (optional)
{
"path": "/Users/example/Documents",
"totalSizeBytes": 1048576000,
"totalSizeMB": 1000,
"folders": 150,
"files": 2500,
"types": {
"images": 450,
"documents": 800,
"code": 300,
"other": 950
},
"largeFiles": [...],
"duplicateGroups": [...]
}
Generate beautiful HTML reports with:
- π Interactive charts
- π Size distribution graphs
- ποΈ File type breakdowns
- π Detailed file listings
- π¨ Modern, responsive design
Export data to CSV for further analysis in spreadsheet applications.
Use programmatically in your Node.js applications:
import { DirectoryAnalyzer } from 'dir-analysis-tool';
const analyzer = new DirectoryAnalyzer();
const result = await analyzer.analyze({
path: '/path/to/analyze',
recursive: true,
excludePatterns: ['node_modules'],
largeSizeThreshold: 100 * 1024 * 1024, // 100MB
enableDuplicateDetection: true,
topN: 10
});
console.log(result);
- π§Ή Disk Cleanup - Identify large files and duplicates consuming disk space
- π Project Analysis - Analyze project structure and file distributions
- π Storage Audit - Understand storage usage patterns
- π Capacity Planning - Monitor directory growth over time
- π Performance Optimization - Identify bottlenecks in file systems
- π Documentation - Generate reports for system documentation
- π Backup Planning - Identify important files and directories
- Node.js >= 18.0.0
- npm or pnpm or yarn
- Operating System: Windows, macOS, or Linux