{"id":15390202,"url":"https://github.com/gajus/gitinfo","last_synced_at":"2025-04-15T06:12:37.997Z","repository":{"id":23446113,"uuid":"26809740","full_name":"gajus/gitinfo","owner":"gajus","description":"Gets information about a Git repository.","archived":false,"fork":false,"pushed_at":"2019-11-25T08:51:24.000Z","size":146,"stargazers_count":47,"open_issues_count":4,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-15T06:12:32.591Z","etag":null,"topics":["github"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gajus.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}},"created_at":"2014-11-18T13:11:39.000Z","updated_at":"2022-10-04T10:17:27.000Z","dependencies_parsed_at":"2022-08-22T01:10:41.536Z","dependency_job_id":null,"html_url":"https://github.com/gajus/gitinfo","commit_stats":null,"previous_names":[],"tags_count":106,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gajus%2Fgitinfo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gajus%2Fgitinfo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gajus%2Fgitinfo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gajus%2Fgitinfo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gajus","download_url":"https://codeload.github.com/gajus/gitinfo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249016638,"owners_count":21198833,"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":["github"],"created_at":"2024-10-01T15:04:55.386Z","updated_at":"2025-04-15T06:12:37.980Z","avatar_url":"https://github.com/gajus.png","language":"JavaScript","readme":"# gitinfo\n\n[![Travis build status](http://img.shields.io/travis/gajus/gitinfo/master.svg?style=flat-square)](https://travis-ci.org/gajus/gitinfo)\n[![NPM version](http://img.shields.io/npm/v/gitinfo.svg?style=flat-square)](https://www.npmjs.org/package/gitinfo)\n[![Canonical Code Style](https://img.shields.io/badge/code%20style-canonical-blue.svg?style=flat-square)](https://github.com/gajus/canonical)\n\nGets information about Git repository.\n\n## Implementation\n\ngitinfo reads the contents of the `./git` directory to extract information.\n\n## API\n\n```js\nimport createGitinfo from 'gitinfo';\n\n/**\n * @typedef Configuration\n * @property {string} [defaultBranchName] Default branch name to fallback to. Default: throws an error if branch cannot be resolved.\n * @property {string} [gitPath] Path used to resolve .git path. Defaults to `__dirname`.\n */\n\n/**\n * @access public\n * @name createGitinfo\n * @param {Configuration} userConfig\n */\nconst gitinfo = createGitinfo();\n\n/**\n * Returns **Any** GitHub repository URL.\n */\ngitinfo.getGithubUrl();\n\n/**\n * Returns **Any** Name of the current branch.\n */\ngitinfo.getBranchName();\n\n/**\n * Returns **Any** Remote URL of the current branch.\n */\ngitinfo.getRemoteUrl();\n\n/**\n * Returns **Any** Absolute path to the .git/ directory.\n */\ngitinfo.getGitPath();\n\n/**\n * Returns **Any** Username of the repository author.\n */\ngitinfo.getUsername();\n\n/**\n * Returns **Any** Repository name.\n */\ngitinfo.getName();\n\n/**\n * Returns **Any** Commit SHA of the current branch.\n */\ngitinfo.getHeadSha();\n\n/**\n * Returns **Any** Representation of the .git/config file.\n */\ngitinfo.getConfig();\n\n```\n\n## Download\n\nDownload using NPM:\n\n```sh\nnpm install gitinfo\n\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgajus%2Fgitinfo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgajus%2Fgitinfo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgajus%2Fgitinfo/lists"}