Skip to content

Commit 4ea0e61

Browse files
docs: update README.md
1 parent 18341ec commit 4ea0e61

File tree

1 file changed

+81
-6
lines changed

1 file changed

+81
-6
lines changed

README.md

Lines changed: 81 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- 📦 Publish-ready for NPM usage
88
- 🔍 Automatically validates URL accessibility before analysis
99
- 📊 Comprehensive progress reporting and analysis summaries
10+
- 📝 Multiple export formats (HTML, JSON, Markdown)
1011

1112
## 📦 Installation
1213

@@ -50,13 +51,26 @@ frontend-performance-analyzer --input urls.json
5051
# Save HTML report (automatically named based on URL)
5152
frontend-performance-analyzer --url https://example.com --output
5253

54+
# Save JSON report to file
55+
frontend-performance-analyzer --url https://example.com --json-file report.json
56+
5357
# Save Markdown summary (automatically named based on URL)
5458
frontend-performance-analyzer --url https://example.com --markdown
5559

5660
# Output raw JSON to console
5761
frontend-performance-analyzer --url https://example.com --json
5862
```
5963

64+
### Logging and Verbosity Options
65+
66+
```bash
67+
# Verbose output with debugging details
68+
frontend-performance-analyzer --url https://example.com --verbose
69+
70+
# Minimal output (errors and final results only)
71+
frontend-performance-analyzer --url https://example.com --silent
72+
```
73+
6074
### Use Performance Threshold
6175

6276
Exit with failure if score is below threshold:
@@ -70,9 +84,10 @@ frontend-performance-analyzer --url https://example.com --threshold 85
7084
The tool automatically:
7185

7286
- ✅ Validates URL format before analysis
73-
- 🔍 Checks URL accessibility with HEAD requests
87+
- 🔍 Checks URL accessibility with HEAD requests and 10-second timeout
7488
- ⚠️ Warns about inaccessible URLs and skips them
7589
- 📊 Provides detailed progress reporting during analysis
90+
- 🔄 Continues analysis even if some URLs fail
7691

7792
## 📊 Sample Output
7893

@@ -108,15 +123,61 @@ Cumulative Layout Shift: 0.01
108123
- `.txt`: List of URLs separated by new lines
109124
- `.json`: JSON array of URLs, e.g. `["https://example.com", "https://github.com"]`
110125

111-
## 🚨 Error Handling
126+
## 📄 Export Formats
127+
128+
### HTML Reports
129+
130+
- Full Lighthouse HTML report with all details
131+
- Automatically named based on URL (e.g., `example_com.html`)
132+
133+
### JSON Reports
134+
135+
- Structured JSON output with performance metrics
136+
- Includes timestamp, tool version, and detailed scores
137+
- Supports both single URL and batch analysis
138+
- Contains all Lighthouse categories (Performance, Accessibility, Best Practices, SEO, PWA)
139+
140+
### Markdown Reports
141+
142+
- Human-readable performance summary
143+
- Core Web Vitals breakdown with visual indicators
144+
- Performance opportunities and diagnostics
145+
- Category scores with emoji indicators
146+
- Automatically named based on URL (e.g., `example_com.md`)
112147

113-
The tool provides comprehensive validation:
148+
## 🚨 Error Handling & Validation
114149

115-
- **Invalid URLs**: checks URL format before processing
116-
- **Inaccessible URLs**: tests connectivity and skips unreachable sites
117-
- **File validation**: ensures input files exist and have correct extensions
150+
The tool provides comprehensive validation and error handling:
151+
152+
- **Invalid URLs**: validates URL format before processing
153+
- **Inaccessible URLs**: tests connectivity with HEAD requests and 10-second timeout
154+
- **File validation**: ensures input files exist and have correct extensions (.txt or .json)
118155
- **Threshold validation**: validates threshold values are between 0-100
119156
- **Graceful failures**: continues analysis even if some URLs fail
157+
- **Lighthouse warnings**: filters internal Lighthouse warnings for cleaner output
158+
- **Browser management**: proper cleanup of browser instances
159+
160+
## 🔧 Advanced Features
161+
162+
### Logging Levels
163+
164+
- **Normal**: standard output with progress indicators
165+
- **Verbose** (`--verbose`): detailed debugging information including timing
166+
- **Silent** (`--silent`): minimal output, errors and final results only
167+
168+
### Performance Monitoring
169+
170+
- Tracks analysis time per URL
171+
- Reports overall performance (URLs/second)
172+
- Browser launch and close timing
173+
- Accessibility check timing
174+
175+
### Batch Processing
176+
177+
- Supports multiple URL analysis in a single run
178+
- Consolidated JSON export for batch results
179+
- Individual file exports for each URL
180+
- Progress tracking with clear indicators
120181

121182
## 🛠 Development
122183

@@ -127,6 +188,20 @@ npm install
127188
node cli.js --url https://example.com
128189
```
129190

191+
### Project Structure
192+
193+
```
194+
├── cli.js # Main CLI entry point
195+
├── lib/
196+
│ ├── lighthouse.js # Lighthouse analysis logic
197+
│ ├── logger.js # Logging utilities
198+
│ └── url-utils.js # URL validation and processing
199+
└── report-formatters/
200+
├── console.js # Console output formatting
201+
├── json.js # JSON export functionality
202+
└── markdown.js # Markdown report generation
203+
```
204+
130205
## 📄 License
131206

132207
MIT © 2025 Oleksandr Zadvornyi

0 commit comments

Comments
 (0)