{"id":15834099,"url":"https://github.com/kaelzhang/nodegit-read-config","last_synced_at":"2025-10-29T23:46:07.043Z","repository":{"id":57131585,"uuid":"185040459","full_name":"kaelzhang/nodegit-read-config","owner":"kaelzhang","description":"Read config for @nodegit commands","archived":false,"fork":false,"pushed_at":"2019-05-06T13:51:11.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T13:16:18.571Z","etag":null,"topics":["node-git","util"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kaelzhang.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-05T14:15:49.000Z","updated_at":"2019-05-06T13:51:13.000Z","dependencies_parsed_at":"2022-08-31T20:00:29.733Z","dependency_job_id":null,"html_url":"https://github.com/kaelzhang/nodegit-read-config","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaelzhang%2Fnodegit-read-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaelzhang%2Fnodegit-read-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaelzhang%2Fnodegit-read-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaelzhang%2Fnodegit-read-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kaelzhang","download_url":"https://codeload.github.com/kaelzhang/nodegit-read-config/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246638160,"owners_count":20809755,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["node-git","util"],"created_at":"2024-10-05T14:00:47.672Z","updated_at":"2025-10-29T23:46:06.933Z","avatar_url":"https://github.com/kaelzhang.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/kaelzhang/nodegit-read-config.svg?branch=master)](https://travis-ci.org/kaelzhang/nodegit-read-config)\n[![Coverage](https://codecov.io/gh/kaelzhang/nodegit-read-config/branch/master/graph/badge.svg)](https://codecov.io/gh/kaelzhang/nodegit-read-config)\n\u003c!-- optional appveyor tst\n[![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/kaelzhang/nodegit-read-config?branch=master\u0026svg=true)](https://ci.appveyor.com/project/kaelzhang/nodegit-read-config)\n--\u003e\n\u003c!-- optional npm version\n[![NPM version](https://badge.fury.io/js/@nodegit/read-config.svg)](http://badge.fury.io/js/@nodegit/read-config)\n--\u003e\n\u003c!-- optional npm downloads\n[![npm module downloads per month](http://img.shields.io/npm/dm/@nodegit/read-config.svg)](https://www.npmjs.org/package/@nodegit/read-config)\n--\u003e\n\u003c!-- optional dependency status\n[![Dependency Status](https://david-dm.org/kaelzhang/nodegit-read-config.svg)](https://david-dm.org/kaelzhang/nodegit-read-config)\n--\u003e\n\n# @nodegit/read-config\n\nRead config for @nodegit commands\n\n## Install\n\n```sh\n$ npm i @nodegit/read-config\n```\n\n## Usage\n\n```js\nconst config = require('@nodegit/read-config')\nconst {read, edit, path} = config('push', {\n  defaults: {\n    allowForcePush: true\n  }\n})\n\nconsole.log(await read())\n```\n\n## config(name, options)\n\n- **name** `string` name of the config which indicates that the config file will be located at `~/.nodegit/config/${name}.js`\n- **options** `Object`\n  - **defaults?** `Object` the default value of the configuration\n  - **defaultFileContent?** `string | Buffer` the default configuration content to be used if there is no config file found.\n\nIf `options.defaults` is specified, then it will ignore `options.defaultFileContent`.\n\n```js\nconst {read} = config('push', {\n  defaultFileContent:\n`module.exports = {\n  editor: 'vscode'\n}`\n})\n\nconst {editor} = await read()\n```\n\n### await read(): Object\n\nGet the local config. If there is no config file found, it will create one.\n\n### await edit(): void\n\nOpen the default editor and edit the config file\n\n### getter: path\n\nReturns `path` the absolute pathname of the config file\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaelzhang%2Fnodegit-read-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaelzhang%2Fnodegit-read-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaelzhang%2Fnodegit-read-config/lists"}