# git-config

> A simple way to extract out all the contents of a .gitconfig file and return as JSON

Latest version **0.0.7** (published 2015-06-13) · BSD-3-Clause license · 7.9K weekly downloads

## Install

```sh
npm install git-config
pnpm add git-config
yarn add git-config
bun add git-config
```

## Health

**Score 33/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.7 |
| Published | 2015-06-13 |
| First published | 2013-09-11 |
| Weekly downloads | 7.9K |
| License | BSD-3-Clause |
| TypeScript types | separate (@types/git-config) |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 25 |
| Author | Eugene Ware |
| Maintainers | eugeneware |

## Links

- npm: https://www.npmjs.com/package/git-config
- Repository: https://github.com/eugeneware/git-config
- Issues: https://github.com/eugeneware/git-config/issues
- npm.io page: https://npm.io/package/git-config

## Dependencies (1)

- [iniparser](https://npm.io/package/iniparser.md) ~1.0.5

## Recent versions

- 0.0.7 (latest) — 2015-06-13
- 0.0.6 — 2014-02-26
- 0.0.5 — 2014-02-26
- 0.0.4 — 2014-02-25
- 0.0.3 — 2013-09-11
- 0.0.2 — 2013-09-11
- 0.0.1 — 2013-09-11

## README

# git-config

A simple way to extract out all the contents of a .gitconfig file and return as JSON

[![build status](https://secure.travis-ci.org/eugeneware/git-config.png)](http://travis-ci.org/eugeneware/git-config)

## Installation

This module is installed via npm:

``` bash
$ npm install git-config
```

## Example Usage

### Asynchronous

``` js
var gitConfig = require('git-config');
gitConfig(function (err, config) {
  if (err) return done(err);
  expect(config.user.name).to.equal('Eugene Ware');
  expect(config.user.email).to.equal('eugene@noblesamurai.com');
  expect(config.github.user).to.equal('eugeneware');
  done();
});
```

Explicitly give a gitconfig file:

``` js
var gitConfig = require('git-config');
gitConfig('/my/path/.gitconfig1', function (err, config) {
  if (err) return done(err);
  expect(config.user.name).to.equal('Eugene Ware');
  expect(config.user.email).to.equal('eugene@noblesamurai.com');
  expect(config.github.user).to.equal('eugeneware');
  done();
});
```

### Synchronous

``` js
var gitConfig = require('git-config');
var config = gitConfig.sync(); // can pass explit file if you want as well
```

---
_Source: https://npm.io/package/git-config · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
