2.1.0 • Published 3 years ago
read-git-user v2.1.0
read-git-user
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 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
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