gitconfiglocal
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/gitconfiglocal package

2.1.0 • Public • Published

Build Status

gitconfiglocal

parse the .git/config file into a useful data structure

example

  • search config in $GIT_DIR (.git by default)
var gitconfig = require('gitconfiglocal');
 
gitconfig('./',function(err,config){
  console.log(config);
  /* prints:
  { core:
     { repositoryformatversion: '0',
       filemode: true,
       bare: false,
       logallrefupdates: true },
    remote:
     { origin:
        { url: 'git@github.com:soldair/node-gitconfiglocal.git',
          fetch: '+refs/heads/*:refs/remotes/origin/*' } } }
  */
});
 
  • specify $GIT_DIR via options:
gitconfig('./', { gitDir: 'path/to/gitdir' }, cb);
 

Dependencies (1)

Dev Dependencies (2)

Package Sidebar

Install

npm i gitconfiglocal

Weekly Downloads

1,915,145

Version

2.1.0

License

BSD

Unpacked Size

4.5 kB

Total Files

5

Last publish

Collaborators

  • soldair