nconf icon indicating copy to clipboard operation
nconf copied to clipboard

What's the best way to cope with variables that depend on other variables

Open tkrugg opened this issue 9 years ago • 1 comments

Say for example I have two variables

{
   "port": 3000
   "url": "http://site.com:{port}"
}

I'd like that when I call nconf.get("url"), I get "http://site.com:3000". I tried

nconf.set("url", nconf.get("url").replace(...));

but it seems that once a variable is "loaded" into nconf, it's impossible to override it. Question 1: can I force nconf.set to override a variable that's already been declared? Question 2: what's the recommended way to cope with variables that depend on each other?

tkrugg avatar May 05 '16 11:05 tkrugg

it looks like i just posted a dup of #197 #187 #166

tkrugg avatar May 05 '16 12:05 tkrugg