Hello!

I'm writing a library that will be used as a submodule and I would like to
allow developers to setup configuration for it.  A few of these config
options would be setting defaults for server url, login and password.

Is there already a pattern for dealing with this situation?  I imagine it
could be done a couple of ways:


   1. The submodule will always look for a config at some "hard-coded"
   location in the app hierarchy i.e. {app}/config/{submodule.config}?  Using
   this method, what is the best way for the submodule to find that location
   relative to the running application at run time?
   2. Provide a function as part of my exports that allows the developer to
   load a config from any location at run time.  Given this technique, maybe a
   config file is unnecessary and the config settings should just be set using
   javascript rather than loading a file.

Should both methods be used?  Are there other options or patterns that are
common?

Any help is much appreciated!

-- 
Tony

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAJhmvsQQPVaJDimMJO5dMVW75WZpb0OjS6DDQRAzqjoTyGdTrQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to