2.1.0 • Published 3 years ago

read-git-user v2.1.0

Weekly downloads
7
License
MIT
Repository
github
Last release
3 years ago

read-git-user build

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

Highlights

  • Tiny(1.3kB :sparkles:) 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