https://github.com/gh-conf/gh-conf-parse
Parser for parsing information from github config file
https://github.com/gh-conf/gh-conf-parse
gh-conf github-parse nodejs parser
Last synced: about 1 year ago
JSON representation
Parser for parsing information from github config file
- Host: GitHub
- URL: https://github.com/gh-conf/gh-conf-parse
- Owner: gh-conf
- License: mit
- Created: 2019-05-24T09:01:03.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-07-11T09:38:14.000Z (almost 4 years ago)
- Last Synced: 2024-11-28T17:18:26.590Z (over 1 year ago)
- Topics: gh-conf, github-parse, nodejs, parser
- Language: JavaScript
- Size: 92.8 KB
- Stars: 1
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# gh-conf-parse
[](https://github.com/gh-conf/gh-conf-parse/actions/workflows/nodejs.yml)
[](https://github.com/gh-conf/gh-conf-parse)
[](https://github.com/gh-conf/gh-conf-parse/LICENSE)
[](https://www.npmjs.com/package/@gh-conf/gh-conf-parse)
[](https://www.npmjs.com/package/@gh-conf/gh-conf-parse)
[](https://github.com/gh-conf/gh-conf-parse/graphs/contributors)
[](https://github.com/gh-conf/gh-conf-parse/commits/master)
Parser for parsing information from github config file
## Install
```
npm install @gh-conf/gh-conf-parse
```
## Usage
```js
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](https://github.com/gh-conf/gh-conf-parse/issues/new).
Read our contributing [guide](CONTRIBUTING.md) to get started with contributing to the codebase.
## Contributors
Thank you to all the contributors who have helped us in making this project better 🙌