{"id":27448380,"url":"https://github.com/mutasim77/loc-counter","last_synced_at":"2026-01-23T11:53:47.165Z","repository":{"id":285655696,"uuid":"955866894","full_name":"mutasim77/loc-counter","owner":"mutasim77","description":"📊 Beautiful zero-install CLI tool that instantly analyzes codebases across 20+ languages with colorful metrics.","archived":false,"fork":false,"pushed_at":"2025-04-12T06:30:25.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-24T16:52:38.054Z","etag":null,"topics":["cli-tool","code-analysis","loc","metrics","ts"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@mutasim77/loc-counter","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mutasim77.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-03-27T10:21:41.000Z","updated_at":"2025-04-12T06:39:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"9886005a-c71c-43b8-b6d1-ef64a61d8547","html_url":"https://github.com/mutasim77/loc-counter","commit_stats":null,"previous_names":["mutasim77/loc-counter"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mutasim77/loc-counter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutasim77%2Floc-counter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutasim77%2Floc-counter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutasim77%2Floc-counter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutasim77%2Floc-counter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mutasim77","download_url":"https://codeload.github.com/mutasim77/loc-counter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutasim77%2Floc-counter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28690606,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T11:01:27.039Z","status":"ssl_error","status_checked_at":"2026-01-23T11:00:26.909Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cli-tool","code-analysis","loc","metrics","ts"],"created_at":"2025-04-15T07:25:38.971Z","updated_at":"2026-01-23T11:53:47.157Z","avatar_url":"https://github.com/mutasim77.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# loc-counter 📊\n\u003e A powerful lines of code counter with detailed statistics, available as an NPX command.\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\n## Why loc-counter?\nI was working on a monorepo project and wanted to check lines of code metrics across different services. Even though I found some libraries that could do this, I wasn't satisfied with their features or they required too many dependencies. So I decided to create my own tiny package that:\n- Runs directly with npx (no installation needed)\n- Supports a wide range of programming languages\n- Provides beautiful, colorful terminal output\n- Shows detailed statistics and breakdowns\n- Is easy to use and extend\n\n## Features\n- **Zero installation required** - Just run with `npx @mutasim77/loc-counter`\n- **Multiple language support** - JavaScript, TypeScript, JSX, TSX, Go, Python, C, C++, C#, PHP, SQL, Ruby, and more\n- **Detailed statistics** - Total lines, code lines, comment lines, blank lines, and percentages\n- **Language breakdown** - See which languages are used the most in your project\n- **Top files analysis** - Identifies your largest files by line count\n- **Beautiful output** - Colorful tables and statistics in the terminal\n- **Respects .gitignore** - Automatically excludes files you don't want to track\n- **Highly customizable** - Flexible options for filtering files\n\n## Usage\nSimply run it with npx:\n\n```bash\nnpx @mutasim77/loc-counter\n```\n\nThis will analyze the current directory and provide detailed statistics.\n\n### Options\n```\nOptions:\n  -V, --version              output the version number\n  -d, --dir \u003cpath\u003e           directory to analyze (default: \".\")\n  -e, --exclude \u003cpatterns...\u003e patterns to exclude\n  -i, --include \u003cpatterns...\u003e patterns to include\n  --no-ignoregit             do not respect .gitignore rules\n  -v, --verbose              show verbose output\n  -h, --help                 display help for command\n```\n\n### Examples\n```bash\n# Analyze a specific directory\nnpx loc-counter --dir ./src\n\n# Exclude certain patterns\nnpx loc-counter --exclude \"**/*.test.js\" \"**/*.spec.js\"\n\n# Include only specific patterns\nnpx loc-counter --include \"**/*.ts\" \"**/*.tsx\"\n```\n\n## Output Example\nWhen you run loc-counter, you'll see beautiful tables like this:\n\n```\n📊 LOC-COUNTER SUMMARY\n──────────────────────────────────────────────\n\n📈 LANGUAGES BREAKDOWN\n┌───────────┬───────┬────────────┬──────────────┬────────────┬────────────┬────────────┐\n│ Language  │ Files │ Code Lines │ Comment Lines│ Blank Lines│ Total Lines│ Percentage │\n├───────────┼───────┼────────────┼──────────────┼────────────┼────────────┼────────────┤\n│ TypeScript│ 42    │ 3845       │ 578          │ 421        │ 4844       │ 68.53%     │\n│ JavaScript│ 15    │ 954        │ 126          │ 103        │ 1183       │ 17.01%     │\n│ TSX       │ 10    │ 812        │ 45           │ 56         │ 913        │ 14.47%     │\n└───────────┴───────┴────────────┴──────────────┴────────────┴────────────┴────────────┘\n\n📊 TOTAL STATISTICS\n┌─────────────┬─────┐\n│ Total Files │ 67  │\n├─────────────┼─────┤\n│ Total Lines │ 6940│\n├─────────────┼─────┤\n│ Code Lines  │ 5611│\n├─────────────┼─────┤\n│ Comment Line│ 749 │\n├─────────────┼─────┤\n│ Blank Lines │ 580 │\n└─────────────┴─────┘\n```\n\n## Supported Languages\n\nCurrently supports the following languages:\n- JavaScript (js, mjs, cjs)\n- TypeScript (ts, mts, cts)\n- JSX, TSX\n- Python\n- Go\n- C and C++\n- C#\n- PHP\n- SQL\n- Ruby\n- HTML, CSS, SCSS\n- Java\n- Kotlin\n- Swift\n- Rust\n- Shell scripts\n\n## Adding New Languages\n\nWant to add support for more languages? It's easy! Just add a new entry to the `LANGUAGES` array in `src/constants/languages.ts`:\n\n```typescript\n{\n  name: 'YourLanguage',\n  extensions: ['.ext1', '.ext2'],\n  commentPatterns: {\n    singleLine: ['//'], // Single line comment markers\n    multiLine: [{ start: '/*', end: '*/' }] // Multi-line comment markers\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\nDistributed under the MIT License. See [LICENSE](./LICENSE) for more information.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmutasim77%2Floc-counter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmutasim77%2Floc-counter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmutasim77%2Floc-counter/lists"}