Wondering what’s next for npm?Check out our public roadmap! »

    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);
     

    Keywords

    Install

    npm i gitconfiglocal

    DownloadsWeekly Downloads

    1,520,647

    Version

    2.1.0

    License

    BSD

    Unpacked Size

    4.5 kB

    Total Files

    5

    Last publish

    Collaborators

    • avatar