🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

git-config

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

git-config

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

0.0.7
latest
Source
npm
Version published
Weekly downloads
12K
8.82%
Maintainers
1
Weekly downloads
 
Created
Source

git-config

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

build status

Installation

This module is installed via npm:

$ npm install git-config

Example Usage

Asynchronous

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:

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

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

FAQs

Package last updated on 13 Jun 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts