## Usage ```js const parse = require('{%= name %}'); // sync console.log(parse.sync()); // using async/await (async () => console.log(await parse()))(); ``` ## Options ### cwd The starting directory to search from. **Type**: `string` **Default**: `process.cwd()` (current working directory) ### path Either the absolute path to .git `config`, or the path relative to the current working directory. **Type**: `string` **Default**: `.git/config` ### Examples config object Parsed config object will look something like: ```js { core: { repositoryformatversion: '0', filemode: true, bare: false, logallrefupdates: true, ignorecase: true, precomposeunicode: true }, 'remote "origin"': { url: 'https://github.com/jonschlinkert/parse-git-config.git', fetch: '+refs/heads/*:refs/remotes/origin/*' }, 'branch "master"': { remote: 'origin', merge: 'refs/heads/master', ... } } ``` ## API {%= apidocs('index.js') %} ### .expandKeys examples Converts ini-style keys into objects: **Example 1** ```js const parse = require('parse-git-config'); const config = { 'foo "bar"': { doStuff: true }, 'foo "baz"': { doStuff: true } }; console.log(parse.expandKeys(config)); ``` Results in: ```js { foo: { bar: { doStuff: true }, baz: { doStuff: true } } } ``` **Example 2** ```js const parse = require('parse-git-config'); const config = { 'remote "origin"': { url: 'https://github.com/jonschlinkert/normalize-pkg.git', fetch: '+refs/heads/*:refs/remotes/origin/*' }, 'branch "master"': { remote: 'origin', merge: 'refs/heads/master' }, 'branch "dev"': { remote: 'origin', merge: 'refs/heads/dev', rebase: true } }; console.log(parse.expandKeys(config)); ``` Results in: ```js { remote: { origin: { url: 'https://github.com/jonschlinkert/normalize-pkg.git', fetch: '+refs/heads/*:refs/remotes/origin/*' } }, branch: { master: { remote: 'origin', merge: 'refs/heads/master' }, dev: { remote: 'origin', merge: 'refs/heads/dev', rebase: true } } } ```