read-git-user
TypeScript icon, indicating that this package has built-in type declarations

2.1.0 • Public • Published

read-git-user build

Reads the Github username and email from .gitconfig 🔧 and returns it as a json object

Highlights

  • Tiny(1.3kB ✨) and simple
  • Returns the original github-username since the stored git name can be altered and not reliable.
  • Uses Ini to handle the parsing of the ini config file

Install

npm install read-git-user

Usage

import readGitUser = require('read-git-user');
 
(async () => {
        const gitUser = await readGitUser();
        //=> {username: RocktimsSaikia, email: rocktimthedev@gmail.com}
})();

API

readGitUser(options?)

Returns a Promise<object> with the parsed JSON.

options

dir

Type: string
Default: os.homedir()

The directory of the .gitconfig file

License

MIT © Rocktim Saikia

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.1.0
    17
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.1.0
    17
  • 2.0.1
    2
  • 2.0.0
    1
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i read-git-user

Weekly Downloads

13

Version

2.1.0

License

MIT

Unpacked Size

4.02 kB

Total Files

5

Last publish

Collaborators

  • rocktimsaikia