Skip to content

Parser for parsing information from github config file

License

Notifications You must be signed in to change notification settings

gh-conf/gh-conf-parse

Repository files navigation

gh-conf-parse

Build Github Repo Size LICENSE NPM Downloads NPM Version Contributors Commit

Parser for parsing information from github config file

Install

npm install @gh-conf/gh-conf-parse

Usage

const { ParseConfig, UserRepo } = require('@gh-conf/gh-conf-parse');

const CurrConfig = ParseConfig();

// Output
// {
//    core:{
//       repositoryformatversion:'0',
//       filemode:'true',
//       bare:'false',
//       logallrefupdates:'true',
//       ignorecase:'true',
//       precomposeunicode:'true'
//    },
//    'remote "origin"':{
//       url:'https://github.com/gh-conf/gh-conf-parse.git',
//       fetch:'+refs/heads/*:refs/remotes/origin/*'
//    },
//    'branch "master"':{
//       remote:'origin',
//       merge:'refs/heads/master'
//    }
// }


const userRepo = UserRepo();

// Output
// {
//   repository:'gh-conf-parse',
//   username:'gh-conf'
// }

API

ParseConfig

  • Returns complete git config as JSON

UserRepo

  • Returns repo owner name and repository name

Contributing

Interested in contributing to this project? You can log any issues or suggestion related to this library here.

Read our contributing guide to get started with contributing to the codebase.

Contributors

Thank you to all the contributors who have helped us in making this project better 🙌