You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jonschlinkert
3181b94870
|
9 years ago | |
---|---|---|
.editorconfig | 9 years ago | |
.eslintrc.json | 9 years ago | |
.gitattributes | 10 years ago | |
.gitignore | 10 years ago | |
.travis.yml | 9 years ago | |
.verb.md | 9 years ago | |
LICENSE | 9 years ago | |
README.md | 9 years ago | |
example.js | 9 years ago | |
index.js | 9 years ago | |
package.json | 9 years ago | |
test.js | 9 years ago |
README.md
parse-git-config
Parse
.git/config
into a JavaScript object. sync or async.
Install
Install with npm:
$ npm install parse-git-config --save
Usage
var git = require('parse-git-config');
// sync
var config = git.sync();
// or async
git(function (err, config) {
// do stuff with err/config
});
Custom path and/or cwd
git.sync({cwd: 'foo', path: '.git/config'});
// async
git({cwd: 'foo', path: '.git/config'}, function (err, config) {
// do stuff
});
Example result
Config object will be something like:
{ 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', ... } }
Related projects
- parse-author: Parse a string into an object with
name
,email
andurl
properties following npm conventions.… more | homepage - parse-authors: Parse a string into an array of objects with
name
,email
andurl
properties following… more | homepage - parse-github-url: Parse a github URL into an object. | homepage
- parse-gitignore: Parse a gitignore file into an array of patterns. Comments and empty lines are stripped. | homepage
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Building docs
Generate readme and API documentation with verb:
$ npm install verb && npm run docs
Or, if verb is installed globally:
$ verb
Running tests
Install dev dependencies:
$ npm install -d && npm test
Author
Jon Schlinkert
License
Copyright © 2016 Jon Schlinkert Released under the MIT license.
This file was generated by verb, v0.9.0, on February 26, 2016.