{"id":22056748,"url":"https://github.com/rocktimsaikia/read-git-user","last_synced_at":"2025-10-11T07:41:11.694Z","repository":{"id":56195737,"uuid":"303106732","full_name":"rocktimsaikia/read-git-user","owner":"rocktimsaikia","description":"Returns the GitHub username and email of the current system's .gitconfig","archived":false,"fork":false,"pushed_at":"2024-07-31T20:15:59.000Z","size":24,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-28T14:58:17.333Z","etag":null,"topics":["gitconfig","github","github-user"],"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/rocktimsaikia.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":"2020-10-11T11:36:50.000Z","updated_at":"2024-07-31T20:17:34.000Z","dependencies_parsed_at":"2025-05-12T16:01:27.502Z","dependency_job_id":"a2bcdfd0-8638-4965-beb6-73af96b18106","html_url":"https://github.com/rocktimsaikia/read-git-user","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/rocktimsaikia/read-git-user","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocktimsaikia%2Fread-git-user","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocktimsaikia%2Fread-git-user/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocktimsaikia%2Fread-git-user/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocktimsaikia%2Fread-git-user/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rocktimsaikia","download_url":"https://codeload.github.com/rocktimsaikia/read-git-user/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocktimsaikia%2Fread-git-user/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279006626,"owners_count":26084131,"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","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"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":["gitconfig","github","github-user"],"created_at":"2024-11-30T16:14:46.128Z","updated_at":"2025-10-11T07:41:11.678Z","avatar_url":"https://github.com/rocktimsaikia.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# read-git-user\n\nReturns the GitHub username and email of the current system's `.gitconfig`.\n\n\u003e [!NOTE]\n\u003e This function retrieves the original GitHub username since the stored \\\n\u003e git config name is not reliable. The local name can be changed without \\\n\u003e affecting any Git or GitHub activities as long as the email matches any \\\n\u003e verified emails on the GitHub account.\n\n[![Tests](https://github.com/rocktimsaikia/read-git-user/actions/workflows/main.yml/badge.svg)](https://github.com/rocktimsaikia/read-git-user/actions/workflows/main.yml) [![npm](https://img.shields.io/npm/v/read-git-user?color=bright)](https://npmjs.com/package/read-git-user)\n\n## Install\n\n```bash\nnpm i read-git-user\n```\n\n## Usage\n\n```js\nimport readGitUser from \"read-git-user\";\n\nconst gitUser = await readGitUser();\n\nconsole.log(gitUser);\n// =\u003e {username: rocktimssaikia, email: rocktimthedev@gmail.com}\n```\n\n## API\n\n### readGitUser(options)\n\nReturns a `Promise\u003cobject\u003e` with the retrieved git config data.\n\n#### Options (`object`) :\n\n##### `dir`\n\n\u003e Type: `string`\u003cbr\u003e\n\u003e Default: `os.homedir()`\n\u003e\n\u003e The directory of the `.gitconfig` file. \\\n\u003e This option is available in-case the config file is not in the default dir for some systems.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frocktimsaikia%2Fread-git-user","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frocktimsaikia%2Fread-git-user","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frocktimsaikia%2Fread-git-user/lists"}