Read config for @nodegit commands
$ npm i @nodegit/read-config
const config = require('@nodegit/read-config')
const {read, edit, path} = config('push', {
defaults: {
allowForcePush: true
}
})
console.log(await read())
- name
string
name of the config which indicates that the config file will be located at~/.nodegit/config/${name}.js
- options
Object
- defaults?
Object
the default value of the configuration - defaultFileContent?
string | Buffer
the default configuration content to be used if there is no config file found.
- defaults?
If options.defaults
is specified, then it will ignore options.defaultFileContent
.
const {read} = config('push', {
defaultFileContent:
`module.exports = {
editor: 'vscode'
}`
})
const {editor} = await read()
Get the local config. If there is no config file found, it will create one.
Open the default editor and edit the config file
Returns path
the absolute pathname of the config file