{"id":23592532,"url":"https://github.com/d-beloved/git-repo-lines-of-code","last_synced_at":"2026-02-09T00:31:25.465Z","repository":{"id":268923178,"uuid":"905869359","full_name":"d-beloved/git-repo-lines-of-code","owner":"d-beloved","description":"Get your Github repository's lines of code with an option of excluding any file from the stat","archived":false,"fork":false,"pushed_at":"2025-01-26T19:19:53.000Z","size":48,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-01T03:33:44.458Z","etag":null,"topics":["developer-productivity-tool","developer-tools","github"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/git-repo-lines-of-code","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/d-beloved.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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-12-19T17:25:51.000Z","updated_at":"2025-01-26T19:19:56.000Z","dependencies_parsed_at":"2025-02-18T07:52:28.483Z","dependency_job_id":null,"html_url":"https://github.com/d-beloved/git-repo-lines-of-code","commit_stats":null,"previous_names":["d-beloved/git-repo-lines-of-code"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/d-beloved/git-repo-lines-of-code","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-beloved%2Fgit-repo-lines-of-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-beloved%2Fgit-repo-lines-of-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-beloved%2Fgit-repo-lines-of-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-beloved%2Fgit-repo-lines-of-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/d-beloved","download_url":"https://codeload.github.com/d-beloved/git-repo-lines-of-code/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-beloved%2Fgit-repo-lines-of-code/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29251473,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-08T22:49:53.206Z","status":"ssl_error","status_checked_at":"2026-02-08T22:49:51.384Z","response_time":57,"last_error":"SSL_read: 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":["developer-productivity-tool","developer-tools","github"],"created_at":"2024-12-27T08:14:22.443Z","updated_at":"2026-02-09T00:31:25.437Z","avatar_url":"https://github.com/d-beloved.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHub Repository Lines of Code\n\nThis project provides a function to calculate the total number of lines of code in a GitHub repository, with the option to exclude specific file paths (The files bloating the number of lines of code and need to be part of the repo, e.g `package-lock.json`, `data.json` etc.).\n\n## Features\n\n- Fetches the total number of lines of code in a given GitHub repository.\n- Allows excluding specific files from the line count.\n\n## Installation\n\n1. Install the package via npm:\n    ```sh\n    npm install git-repo-lines-of-code\n    ```\n\n## Usage\n\n### Function: `getRepoLinesOfCode`\n\nFetches the total number of lines of code in a given repository.\n\n#### Parameters\n\n- `owner` (string): The owner of the GitHub repository.\n- `repo` (string): The name of the GitHub repository.\n- `excludeFilePaths` (string[]): An optional array of file paths to exclude from the line count.\n\n#### Returns\n\n- `Promise\u003cnumber|string\u003e`: The total number of lines of code, minus any lines of code in the given file paths to exclude, or a string describing an error if the data could not be fetched.\n\n#### Example\n\n```typescript\nimport getRepoLinesOfCode from 'git-repo-lines-of-code';\n\nconst owner = 'octocat';\nconst repo = 'Hello-World';\nconst excludeFilePaths = ['path-to-file.ts', 'path-to-auto-generated-code.json'];\n\ngetRepoLinesOfCode(owner, repo, excludeFilePaths)\n    .then((linesOfCode) =\u003e {\n        console.log(`Total lines of code: ${linesOfCode}`);\n    })\n    .catch((error) =\u003e {\n        console.error(`Error: ${error}`);\n    });\n```\n\n## Development\n\n### Prerequisites\n\n- Node.js\n- npm\n\n### Running Locally\n\n1. Clone the repository and install dependencies:\n    ```sh\n    git clone https://github.com/d-beloved/git-repo-lines-of-code.git\n    cd git-repo-lines-of-code\n    npm install\n    ```\n\n2. Run the project:\n    ```sh\n    npm start\n    ```\n\n### Running Tests\n\nTo run the tests, use the following command:\n```sh\nnpm test\n```\n\n## Contributing\n\nContributions are welcome! Please see the CONTRIBUTING file for guidelines on how to contribute to this project.\n\n## License\n\nThis project is licensed under the MIT License. See the LICENSE file for details.\n\n## Acknowledgements\n\n- [GitHub API](https://docs.github.com/en/rest/metrics/statistics?apiVersion=2022-11-28#get-the-weekly-commit-activity)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd-beloved%2Fgit-repo-lines-of-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fd-beloved%2Fgit-repo-lines-of-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd-beloved%2Fgit-repo-lines-of-code/lists"}