Application itself shouldn't even know how configs are stored, not mentioning modifying the objects.
It is a job of a config manager to change configuration while preserving config formatting/comments/etc. Well, I guess it's the difference between config manager and config loader. :P
I know there are a lot of apps that don't need that, so simple config loader will work fine in that case. For a more complex usage I heard https://github.com/dominictarr/rc is recommended, although I never used that myself.
PS: why not simply use "require('js-yaml').safeLoad(require('fs').readFileSync('config', 'utf8'))" anyway ?
04.02.2014, 00:57, "Gagle" <[email protected]>:
--Nope, not necessary. Config loaders load the file... xD. Once you have loaded all the files modify the objects and update the files as you need (be careful if you use a cluster of processes)
El lunes, 3 de febrero de 2014 21:48:55 UTC+1, Alex Kocharin escribió:... and both solutions are unable to update configuration from within the application...04.02.2014, 00:36, "Gagle" <[email protected]>:This module it's like my first attempt at writing a config loader. The problem with it is that you cannot load other file formats different than json or yaml. Also you are making assumptions with the environment. Why the default env should be development? How can I load a .properties, .ini or .xml file? Can I merge configurations based on my own priorities?
This is my config loader. It cannot be more flexible and easy to use... https://github.com/gagle/node-seraphim
El lunes, 3 de febrero de 2014 13:10:42 UTC+1, Ali Davut escribió:Hi, we just published a new library, we expect this will help you to make configuration files easier https://github.com/vngrs/konfig--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.
