read-git-user
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 gitname
can be altered and not reliable. - Uses Ini to handle the parsing of the
ini config
file
Install
npm install read-git-user
Usage
; async { const gitUser = await ; //=> {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