{"id":22173137,"url":"https://github.com/knutkirkhorn/default-branch","last_synced_at":"2026-03-05T02:01:05.058Z","repository":{"id":55497881,"uuid":"116153793","full_name":"knutkirkhorn/default-branch","owner":"knutkirkhorn","description":"Get the default branch of a GitHub repository","archived":false,"fork":false,"pushed_at":"2023-05-08T21:26:56.000Z","size":127,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-14T23:59:27.340Z","etag":null,"topics":["branch","default","github","github-enterprise","nodejs","repository"],"latest_commit_sha":null,"homepage":"","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/knutkirkhorn.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":"2018-01-03T15:42:41.000Z","updated_at":"2025-08-24T05:53:11.000Z","dependencies_parsed_at":"2024-06-21T20:18:00.077Z","dependency_job_id":"751f963f-cb4b-4e6d-a6f3-7586808c8eb3","html_url":"https://github.com/knutkirkhorn/default-branch","commit_stats":{"total_commits":51,"total_committers":4,"mean_commits":12.75,"dds":"0.11764705882352944","last_synced_commit":"0ee6008aff4d8aff02756129baacbe81d5a81056"},"previous_names":["knutakir/default-branch"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/knutkirkhorn/default-branch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knutkirkhorn%2Fdefault-branch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knutkirkhorn%2Fdefault-branch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knutkirkhorn%2Fdefault-branch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knutkirkhorn%2Fdefault-branch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/knutkirkhorn","download_url":"https://codeload.github.com/knutkirkhorn/default-branch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knutkirkhorn%2Fdefault-branch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30106121,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T01:39:18.192Z","status":"online","status_checked_at":"2026-03-05T02:00:06.710Z","response_time":93,"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":["branch","default","github","github-enterprise","nodejs","repository"],"created_at":"2024-12-02T07:30:40.762Z","updated_at":"2026-03-05T02:01:05.041Z","avatar_url":"https://github.com/knutkirkhorn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# default-branch\n\n\u003e Get the default branch of a GitHub repository\n\n## Installation\n\n```\nnpm install default-branch\n```\n\n## Usage\n\n```js\nimport defaultBranch from 'default-branch';\n\nconsole.log(await defaultBranch('knutkirkhorn/emorjis'));\n// =\u003e main\n\nconsole.log(await defaultBranch('https://github.com/knutkirkhorn/btc-value-cli'));\n// =\u003e main\n\nconsole.log(await defaultBranch('https://enterprise.github.corp/org/repo'));\n// =\u003e default\n```\n\n## API\n\n### defaultBranch(path)\n\nReturns the default branch of a repository. The `path` can be `username/repo-name`, or a full url to the repository (example: `https://github.com/knutkirkhorn/btc-value-cli`).\n\n## Related\n\n- [has-license](https://github.com/knutkirkhorn/has-license) - Check if a repository has a license\n- [gh-repo-has-license](https://github.com/knutkirkhorn/gh-repo-has-license) - Check if a GitHub repository has a license\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknutkirkhorn%2Fdefault-branch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknutkirkhorn%2Fdefault-branch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknutkirkhorn%2Fdefault-branch/lists"}