git-config
A simple way to extract out all the contents of a .gitconfig file and return as JSON
Last updated 9 years ago by eugeneware .
BSD-3-Clause · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install git-config 
SYNC missed versions from official npm registry.

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

Current Tags

  • 0.0.7                                ...           latest (9 years ago)

7 Versions

  • 0.0.7                                ...           9 years ago
  • 0.0.6                                ...           11 years ago
  • 0.0.5                                ...           11 years ago
  • 0.0.4                                ...           11 years ago
  • 0.0.3                                ...           11 years ago
  • 0.0.2                                ...           11 years ago
  • 0.0.1                                ...           11 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (7)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |