New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

read-git-user

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

read-git-user

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

latest
Source
npmnpm
Version
3.0.0
Version published
Maintainers
1
Created
Source

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 npm

Install

npm i read-git-user

Usage

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
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.

Keywords

git

FAQs

Package last updated on 31 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts