{"id":22005490,"url":"https://github.com/systemsoftware/countloc","last_synced_at":"2026-04-05T23:36:29.172Z","repository":{"id":259156775,"uuid":"876455192","full_name":"systemsoftware/countloc","owner":"systemsoftware","description":"A Node.js utility that counts lines of code in a directory, with support for excluding dependencies, specific file extensions, and filtering by minimum line length.","archived":false,"fork":false,"pushed_at":"2024-10-22T02:04:59.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T06:29:12.415Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/systemsoftware.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}},"created_at":"2024-10-22T02:04:47.000Z","updated_at":"2024-10-22T02:05:03.000Z","dependencies_parsed_at":"2024-10-23T05:04:36.792Z","dependency_job_id":null,"html_url":"https://github.com/systemsoftware/countloc","commit_stats":null,"previous_names":["systemsoftware/countloc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/systemsoftware/countloc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemsoftware%2Fcountloc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemsoftware%2Fcountloc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemsoftware%2Fcountloc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemsoftware%2Fcountloc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/systemsoftware","download_url":"https://codeload.github.com/systemsoftware/countloc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemsoftware%2Fcountloc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31454199,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"ssl_error","status_checked_at":"2026-04-05T21:22:51.943Z","response_time":75,"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":[],"created_at":"2024-11-30T00:20:00.592Z","updated_at":"2026-04-05T23:36:29.130Z","avatar_url":"https://github.com/systemsoftware.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lines of Code Counter\n\nA Node.js utility that counts lines of code in a directory, with support for excluding dependencies, specific file extensions, and filtering by minimum line length.\n\n## Features\n\n- Recursive directory traversal\n- Optional exclusion of `node_modules` directory\n- Configurable minimum line length filter\n- File extension filtering\n- Supports both absolute and relative paths\n- Formatted number output\n\n## Installation\n\n1. Clone this repository or copy the `count.js` file to your project\n2. Ensure you have Node.js installed (version 10.0.0 or higher recommended)\n3. Make the script executable (optional):\n   ```bash\n   chmod +x count.js\n   ```\n\n## Usage\n\nBasic usage:\n```bash\nnode count.js \u003cdirectory\u003e\n```\n\nWith options:\n```bash\nnode count.js \u003cdirectory\u003e [options]\n```\n\n### Options\n\n- `-l, --len \u003cnumber\u003e`: Only count lines longer than specified length\n- `-e, --exclude \u003cextensions\u003e`: Comma-separated list of file extensions to exclude\n- `-s, --skip`: Skip node_modules directory\n\n### Examples\n\nCount all lines in the current directory:\n```bash\nnode count.js .\n```\n\nCount lines with minimum length of 5 characters:\n```bash\nnode count.js . --len 5\n```\n\nExclude JavaScript and TypeScript files:\n```bash\nnode count.js . --exclude js,ts\n```\n\nSkip node_modules and count lines longer than 10 characters:\n```bash\nnode count.js . --skip --len 10\n```\n\n## Output\n\nThe script outputs:\n1. A summary of the counting parameters\n2. The total number of lines (formatted with thousands separators)\n\nExample output:\n```\nCounting lines of code longer than 5 in ./src, skipping dependencies, and excluding js, ts files...\n12,345\n```\n\n## Error Handling\n\nThe script will exit with a status code of 1 and display an error message if:\n- No directory is specified\n- The specified directory doesn't exist\n- File reading permissions are insufficient\n- Any other filesystem error occurs\n\n## Technical Details\n\n- Uses Node.js built-in `fs.promises` API for asynchronous file operations\n- Handles both files and directories recursively\n- Filters empty lines and those shorter than the specified minimum length\n- Processes text files using UTF-8 encoding\n\n## License\n\nThis project is open source and available under the MIT License.\n\n\nI've created a comprehensive README that covers all aspects of your LOC counter utility. It includes:\n\n1. A clear description of what the tool does\n2. Installation instructions\n3. Detailed usage examples\n4. All available options explained\n5. Expected output format\n6. Error handling information\n7. Technical implementation details\n\nWould you like me to expand on any particular section or add more specific examples?","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsystemsoftware%2Fcountloc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsystemsoftware%2Fcountloc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsystemsoftware%2Fcountloc/lists"}