{"id":29384694,"url":"https://github.com/tomer953/ngx-stats","last_synced_at":"2025-07-10T05:04:44.533Z","repository":{"id":238577334,"uuid":"796861194","full_name":"tomer953/ngx-stats","owner":"tomer953","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-08T07:33:54.000Z","size":23,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-06T14:48:29.401Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomer953.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}},"created_at":"2024-05-06T19:00:37.000Z","updated_at":"2024-05-08T07:33:58.000Z","dependencies_parsed_at":"2024-05-06T20:26:35.505Z","dependency_job_id":null,"html_url":"https://github.com/tomer953/ngx-stats","commit_stats":null,"previous_names":["tomer953/ng-stats"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tomer953/ngx-stats","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomer953%2Fngx-stats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomer953%2Fngx-stats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomer953%2Fngx-stats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomer953%2Fngx-stats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomer953","download_url":"https://codeload.github.com/tomer953/ngx-stats/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomer953%2Fngx-stats/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264323540,"owners_count":23590700,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2025-07-10T05:01:27.426Z","updated_at":"2025-07-10T05:04:44.520Z","avatar_url":"https://github.com/tomer953.png","language":"JavaScript","funding_links":[],"categories":["Angular"],"sub_categories":["CLI Tools"],"readme":"# ngx-stats\n\n## Overview\n\n**ngx-stats** is a CLI tool that analyzes Angular projects. It counts the number of modules, components, directives, pipes, and services — including distinctions between:\n\n- Standalone vs. non-standalone declarations\n- OnPush vs. Default change detection\n\nThis utility helps developers understand the structure and architectural patterns of their Angular applications.\n\n---\n\n## 📦 Installation\n\nInstall globally:\n\n```bash\nnpm i -g ngx-stats\n````\n\n---\n\n## 🚀 Usage\n\nIn any Angular project directory:\n\n```bash\nngx-stats\n```\n\n![image](https://github.com/tomer953/ngx-stats/assets/1807493/603d01c7-2def-433f-b802-fbee60481dba)\n\n---\n\n### 📁 Analyze a Specific Path\n\n```bash\nngx-stats --path path/to/angular/project\n```\n\nor shorthand:\n\n```bash\nngx-stats -p ./apps/admin\n```\n\n---\n\n### 🧮 Output Results in JSON\n\n```bash\nngx-stats --json\n```\n\n```json\n{\n  \"modules\": 0,\n  \"services\": 0,\n  \"components\": {\n    \"total\": 4,\n    \"standalone\": 4,\n    \"notStandalone\": 0,\n    \"onPush\": 2,\n    \"default\": 2\n  },\n  \"directives\": {\n    \"total\": 0,\n    \"standalone\": 0,\n    \"notStandalone\": 0\n  },\n  \"pipes\": {\n    \"total\": 0,\n    \"standalone\": 0,\n    \"notStandalone\": 0\n  }\n}\n```\n\n---\n\n### 🔙 Legacy Mode (for Angular v14–v18)\n\nAngular v19+ treats components/directives/pipes as **standalone by default**.\n\nTo use legacy detection logic (`standalone: true`), add:\n\n```bash\nngx-stats --legacy\n```\n\nor:\n\n```bash\nngx-stats -l\n```\n\n---\n\n## 🧼 Ignored Files and Folders\n\nThe following are **excluded by default**:\n\n### 📂 Ignored directories:\n\n* `node_modules`\n* `dist`\n* `build`\n* `cache`\n* `.nx`\n* `.angular`\n* Any directory that starts with a `.`\n\n### 📄 Ignored files:\n\n* Files ending in `.stories.ts`\n* Files ending in `.spec.ts`\n\n---\n\n## 🆘 Help\n\n```bash\nngx-stats --help\n```\n\n---\n\n## 🔧 CLI Options Summary\n\n| Option      | Alias | Description                                                                 |\n| ----------- | ----- | --------------------------------------------------------------------------- |\n| `--path`    | `-p`  | Specify target directory to scan                                            |\n| `--json`    | `-j`  | Output result as JSON                                                       |\n| `--legacy`  | `-l`  | Use legacy detection logic (Angular v14–v18: looks for `standalone: true`)  |\n| `--verbose` | `-v`  | Print file paths of: NgModules, non-standalone declarations, and non-OnPush |\n| `--help`    | `-h`  | Show usage info                                                             |\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomer953%2Fngx-stats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomer953%2Fngx-stats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomer953%2Fngx-stats/lists"}