Socket
Socket
Sign inDemoInstall

git-config

Package Overview
Dependencies
1
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

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


Version published
Weekly downloads
7.6K
increased by9.12%
Maintainers
1
Install size
16.6 kB
Created
Weekly downloads
 

Readme

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

Last updated on 13 Jun 2015

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc