{"id":36542011,"url":"https://github.com/eawebmaster20/ngperf","last_synced_at":"2026-01-12T05:48:01.475Z","repository":{"id":305571264,"uuid":"1023063396","full_name":"eawebmaster20/ngperf","owner":"eawebmaster20","description":"A comprehensive Angular performance analyzer that identifies performance bottlenecks, memory leaks, and optimization opportunities in Angular applications.","archived":false,"fork":false,"pushed_at":"2025-07-25T23:34:23.000Z","size":49,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-01T12:44:14.951Z","etag":null,"topics":["angular","change-detection","cli","memory-leaks","onpush","optimization","performance-analyzer","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/ngperf-audit","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eawebmaster20.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-20T12:57:38.000Z","updated_at":"2025-07-25T23:21:12.000Z","dependencies_parsed_at":"2025-07-20T22:09:36.169Z","dependency_job_id":"ca71127b-20c1-41eb-b9ef-13ba8b79f4ad","html_url":"https://github.com/eawebmaster20/ngperf","commit_stats":null,"previous_names":["eawebmaster20/ngperf"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/eawebmaster20/ngperf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eawebmaster20%2Fngperf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eawebmaster20%2Fngperf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eawebmaster20%2Fngperf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eawebmaster20%2Fngperf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eawebmaster20","download_url":"https://codeload.github.com/eawebmaster20/ngperf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eawebmaster20%2Fngperf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28335271,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"online","status_checked_at":"2026-01-12T02:00:08.677Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","change-detection","cli","memory-leaks","onpush","optimization","performance-analyzer","typescript"],"created_at":"2026-01-12T05:47:58.527Z","updated_at":"2026-01-12T05:48:01.466Z","avatar_url":"https://github.com/eawebmaster20.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ngperf-audit\n\nA comprehensive Angular performance analyzer that identifies performance bottlenecks, memory leaks, and optimization opportunities in Angular applications.\n\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n## Features\n\n- 🔍 **Smart OnPush Detection** - recommends OnPush for components that would actually benefit from it\n- 🧠 **Memory Leak Detection** - Identifies subscription issues and memory leaks\n- ⚡ **Template Optimization** - Finds missing trackBy functions and template performance issues\n- 📊 **Performance Scoring** - Gives each component a performance score out of 100\n- 📝 **Detailed Reports** - Generates comprehensive markdown reports with actionable recommendations\n- 🎯 **Targeted Analysis** - Focuses on components with actual complexity\n\n## Installation\n\n### Global Installation (Recommended)\n```bash\nnpm install -g ngperf-audit\n```\n\n### Project Installation\n```bash\n# As dev dependency\nnpm install --save-dev ngperf-audit\n\n# Using npx (no installation required)\nnpx ngperf-audit project\n```\n\n## Quick Start\n\n### Command Line Usage\n\n```bash\n# Analyze entire Angular project\nngperf project ./src/app\n\n# Analyze specific component\nngperf component ./src/app/my-component/my-component.ts\n\n# Generate detailed report\nngperf report ./src/app\n\n# Get help\nngperf help\n```\n\n### Programmatic Usage\n\n```typescript\nimport { PerformanceAnalyzerCLI, PerformanceAnalyzer } from 'ngperf-audit';\n\n// Quick analysis with summary\nconst { analyses, summary } = PerformanceAnalyzerCLI.analyzeProjectWithSummary('./src/app');\n\nconsole.log(`Found ${summary.totalComponents} components`);\nconsole.log(`Average score: ${summary.averagePerformanceScore}/100`);\n\n// Generate report\nconst report = PerformanceAnalyzerCLI.generateReportWithSummary(analyses, summary);\nawait PerformanceAnalyzerCLI.saveReportToFile(report, './performance-report.md');\n```\n\n## Commands\n\n### `ngperf project \u003cpath\u003e`\nAnalyzes all Angular components in the specified directory and generates a comprehensive report.\n\n**Options:**\n- `-o, --output \u003cfile\u003e`: Output file path for the report (default: `./performance-report.md`)\n- `-f, --format \u003ctype\u003e`: Report format - `markdown` or `json` (default: `markdown`)\n\n**Examples:**\n```bash\nngperf project ./src/app\nngperf project ./src/app -o ./reports/perf-analysis.md\nngperf project ./src/app -f json\nngperf project ./src/app -o ./reports/analysis.json -f json\n```\n\n### `ngperf component \u003cpath\u003e`\nAnalyzes a single Angular component file.\n\n**Example:**\n```bash\nngperf component ./src/app/user-profile/user-profile.component.ts\n```\n\n### `ngperf report \u003cpath\u003e`\nGenerates a detailed performance report for the specified directory.\n\n### `ngperf help`\nShows help information and available commands.\n\n## What It Analyzes\n\n### 🔥 Smart OnPush Detection\nUnlike other tools that blindly recommend OnPush for every component, ngperf intelligently determines which components would actually benefit:\n\n- ✅ **Recommends OnPush for components with:**\n  - Service injections (HttpClient, APIs, etc.)\n  - Lifecycle hooks (ngOnInit, ngOnChanges)\n  - Observable subscriptions\n  - Form handling (FormBuilder, FormGroup)\n  - Complex methods and computed properties\n  - Event handlers\n  - Template complexity (ngFor, ngIf, event bindings)\n\n- ❌ **Skips simple \"dummy\" components that:**\n  - Only display static content\n  - Have minimal logic\n  - Don't use services or observables\n  - Have simple templates\n\n### 🧠 Memory Leak Detection\n- Manual subscriptions without proper cleanup\n- Missing OnDestroy implementations\n- Multiple subscriptions that could be optimized\n\n### ⚡ Template Performance\n- Missing trackBy functions in ngFor loops\n- Function calls in templates\n- Opportunities for async pipes\n- Large lists that need virtual scrolling\n\n### 📊 Performance Scoring\nEach component gets a score from 0-100 based on:\n- Change detection strategy appropriateness\n- Template optimization\n- Subscription management\n- Overall complexity vs. optimization\n\n## Sample Output\n\n```markdown\n# Angular Performance Analysis Report\n\n## 📊 Project Overview\n- **Components Analyzed**: 12\n- **Average Performance Score**: 78.5/100\n- **Total Issues Found**: 8\n\n## 🚨 Top Priority Components (Lowest Scores)\n1. **UserDashboard** - Score: 65/100\n2. **ProductList** - Score: 70/100\n\n### UserDashboard\n**Performance Score**: 65/100\n\n#### Issues Found (3)\n🔴 **missing-onpush** (high)\n   Component uses default change detection strategy\n   *Fix*: Add ChangeDetectionStrategy.OnPush to component decorator\n\n🟡 **manual-subscription** (medium)\n   Manual subscription without proper cleanup\n   *Fix*: Use async pipe, takeUntil pattern, or implement OnDestroy\n\n🟡 **missing-trackby** (medium)\n   *ngFor loop missing trackBy function\n   *Fix*: Add trackBy function to prevent unnecessary DOM manipulations\n```\n\n## Integration with CI/CD\n\nAdd performance checks to your build process:\n\n```json\n{\n  \"scripts\": {\n    \"perf-check\": \"ngperf project ./src/app --format json\",\n    \"perf-report\": \"ngperf project ./src/app\"\n  }\n}\n```\n\n## Contributing\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## License\n\n**ngperf is free for everyone with attribution requirements** 🎉\n\n### ✅ Free for All Use Cases\n- ✅ Personal projects\n- ✅ Open source projects\n- ✅ Commercial applications\n- ✅ Enterprise use\n- ✅ SaaS products\n- ✅ Consulting work\n\n### � Attribution Required\nJust give credit where it's due! Include attribution in one of these ways:\n\n**In your app's About/Credits section:**\n```\nPerformance analysis powered by ngperf-audit\nCreated by eawebmaster20 (https://eaweb-solutions.com)\n```\n\n**In your project's README:**\n```markdown\n## Performance Analysis\nThis project uses [ngperf-audit](https://github.com/eawebmaster20/ngperf) \nfor Angular performance analysis.\n```\n\n**In CLI output:**\n```\nPowered by ngperf-audit (https://github.com/eawebmaster20/ngperf)\n```\n\n### 🌟 Show Your Appreciation (Optional)\n- ⭐ Star the [GitHub repository](https://github.com/eawebmaster20/ngperf)\n- 🐦 Share on social media\n- 📝 Write about your experience\n- 🔄 Contribute improvements\n\nFull license details: [MIT with Attribution](LICENSE)\n\n## Support\n\n- 🆓 **Community Support**: [GitHub Issues](https://github.com/eawebmaster20/ngperf/issues)\n- 📚 **Documentation**: [GitHub Wiki](https://github.com/eawebmaster20/ngperf/wiki)\n\n- 🐛 [Report bugs](https://github.com/eawebmaster20/ngperf/issues)\n- 💡 [Request features](https://github.com/eawebmaster20/ngperf/issues)\n- 📖 [Documentation](https://github.com/eawebmaster20/ngperf#readme)\n\n---\n\nMade with ❤️ for the Angular community\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feawebmaster20%2Fngperf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feawebmaster20%2Fngperf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feawebmaster20%2Fngperf/lists"}