Reads the Github username and email from
.gitconfig
🔧 and returns it as a json object
- 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
npm install read-git-user
import readGitUser = require('read-git-user');
(async () => {
const gitUser = await readGitUser();
//=> {username: RocktimsSaikia, email: [email protected]}
})();
Returns a Promise<object>
with the parsed JSON.
Type: string
Default: os.homedir()
The directory of the .gitconfig
file
MIT © Rocktim Saikia