nconf
nconf copied to clipboard
Add ref value support
Is there any way that I can use reference value? In order to reduce the number of lines at the config file. At the example bellow, I would like to create a new entry named: common which will contain the db section.
{
"serviceX": {
"param1": "val1",
"param2": "val2",
"db": {
"connection": {
"host": "",
"port": "",
"schema": "",
"username": "",
"password": ""
}
},
"param3": "val3",
"param42": "val4",
"param5": "val5"
},
"serviceY": {
"param1": "val89",
"param2": "val23",
"db": {
"connection": {
"host": "",
"port": "",
"schema": "",
"username": "",
"password": ""
}
},
"param32": "val2",
"param42": "val43"
}
}
@asnir not sure I understand you.
The result will be something like that:
{
"serviceX": {
"param1": "val1",
"param2": "val2",
"db": {
"@ref": "common.db"
},
"param3": "val3",
"param42": "val4",
"param5": "val5"
},
"serviceY": {
"param1": "val89",
"param2": "val23",
"db": {
"@ref": "common.db"
},
"param32": "val2",
"param42": "val43"
},
"common": {
"db": {
"connection": {
"host": "",
"port": "",
"schema": "",
"username": "",
"password": ""
}
}
}
}
No, but a PR would be welcome for this.