1

I've used node-config module in my project, and it pretty useful. But I've encountered use case which I don't know how to handle. Here is an example:
I have a huge config with a lot of nested objects, here is simplified one:

{
db:{
name:"name",
port:3000
}
}

When I make the first call of config.get() config object is being frozen, and all nested properties of config object are immutable. Which is good.

But config.get() returns also frozen object. So you can not do:

db=config.get("db");
db.port=2000;

Is there a way to get nested object form config which would be unfrozen? So I could change it.

Hasta Dhana
  • 4,699
  • 7
  • 17
  • 26

0 Answers0