# read-git-user

> Returns the GitHub username and email of the current system's .gitconfig

Latest version **3.0.0** (published 2024-07-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install read-git-user
pnpm add read-git-user
yarn add read-git-user
bun add read-git-user
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2024-07-31 |
| First published | 2020-10-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=18 |
| Dependencies | 3 |
| Unpacked size | 4.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Rocktim Saikia |
| Maintainers | rocktimsaikia |
| Keywords | git, config, username, email, git username, local |

## Links

- npm: https://www.npmjs.com/package/read-git-user
- Repository: https://github.com/RocktimSaikia/read-git-user
- Homepage: https://github.com/RocktimSaikia/read-git-user#readme
- Issues: https://github.com/RocktimSaikia/read-git-user/issues
- npm.io page: https://npm.io/package/read-git-user

## Dependencies (3)

- [ini](https://npm.io/package/ini.md) ^4.1.3
- [esm-utils](https://npm.io/package/esm-utils.md) ^4.3.0
- [github-username](https://npm.io/package/github-username.md) ^8.0.0

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 3.0.0 (latest) — 2024-07-31
- 2.1.0 — 2020-11-21
- 2.0.1 — 2020-10-12
- 2.0.0 — 2020-10-12
- 1.0.1 — 2020-10-11
- 1.0.0 — 2020-10-11

## README

# read-git-user

Returns the GitHub username and email of the current system's `.gitconfig`.

> [!NOTE]
> This function retrieves the original GitHub username since the stored \
> git config name is not reliable. The local name can be changed without \
> affecting any Git or GitHub activities as long as the email matches any \
> verified emails on the GitHub account.

[![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)

## Install

```bash
npm i read-git-user
```

## Usage

```js
import readGitUser from "read-git-user";

const gitUser = await readGitUser();

console.log(gitUser);
// => {username: rocktimssaikia, email: rocktimthedev@gmail.com}
```

## API

### readGitUser(options)

Returns a `Promise<object>` with the retrieved git config data.

#### Options (`object`) :

##### `dir`

> Type: `string`<br>
> Default: `os.homedir()`
>
> The directory of the `.gitconfig` file. \
> This option is available in-case the config file is not in the default dir for some systems.

---
_Source: https://npm.io/package/read-git-user · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
