From a4af382a120667927668b9110ff3ab5fc068dea8 Mon Sep 17 00:00:00 2001 From: jonschlinkert Date: Tue, 24 Feb 2015 23:17:43 -0500 Subject: [PATCH] build readme --- .verb.md | 25 ++++++++++++++------- README.md | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 8 deletions(-) create mode 100644 README.md diff --git a/.verb.md b/.verb.md index 5e5b1c5..c863389 100644 --- a/.verb.md +++ b/.verb.md @@ -7,22 +7,31 @@ ## Usage ```js -var gitConfig = require('{%= name %}'); -``` +var git = require('{%= name %}'); -### async +// sync +var config = git.sync(); -```js -gitConfig(function (err, config) { +// or async +git(function (err, config) { // do stuff with err/config }); ``` -### sync +Config object will be something like: ```js -gitConfig.sync(); - +{ 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', ... } } ``` diff --git a/README.md b/README.md new file mode 100644 index 0000000..3b36380 --- /dev/null +++ b/README.md @@ -0,0 +1,66 @@ +# parse-git-config [![NPM version](https://badge.fury.io/js/parse-git-config.svg)](http://badge.fury.io/js/parse-git-config) + +> Parse `.git/config` into a JavaScript object. sync or async. + +## Install with [npm](npmjs.org) + +```bash +npm i parse-git-config --save +``` + +## Usage + +```js +var git = require('parse-git-config'); + +// sync +var config = git.sync(); + +// or async +git(function (err, config) { + // do stuff with err/config +}); +``` + +Config object will be something like: + +```js +{ 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', ... } } +``` + + +## Run tests + +Install dev dependencies: + +```bash +npm i -d && npm test +``` + +## Contributing +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/parse-git-config/issues) + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License +Copyright (c) 2015 Jon Schlinkert +Released under the MIT license + +*** + +_This file was generated by [verb](https://github.com/assemble/verb) on February 24, 2015._