JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 960271
  • Score
    100M100P100Q240968F
  • License

Parse `.git/config` into a JavaScript object. sync or async.

Package Exports

  • parse-git-config

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (parse-git-config) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

parse-git-config NPM version Build Status

Parse .git/config into a JavaScript object. sync or async.

Install with npm

npm i 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', ... } }

Other useful projects

  • parse-github-url: Parse a github URL into an object.
  • parse-gitignore: Parse a gitignore file into an array of patterns. Comments and empty lines are stripped.
  • parse-author: Parse a string into an object with name, email and url properties following npm conventions.… more
  • parse-authors: Parse a string into an array of objects with name, email and url properties following… more

Run tests

Install dev dependencies:

npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Author

Jon Schlinkert

github/jonschlinkert twitter/jonschlinkert

License

Copyright (c) 2015 Jon Schlinkert Released under the MIT license.


This file was generated by verb-cli on April 29, 2015.