dominictarr / rc

The non-configurable configuration loader for lazy people.
Other
1.02k stars 97 forks source link

Pass config file path to the `parse` function #59

Closed zaim closed 9 years ago

zaim commented 9 years ago

To support using js/node modules as config files as per #57, a custom parser can use require(path) if appropriate.

This might be a bug, as the default parser accepts a file path as a second argument (https://github.com/dominictarr/rc/blob/master/lib/utils.js#L6), but no such argument is passed when it is called in addConfigFile (https://github.com/dominictarr/rc/blob/master/index.js#L31)?

dominictarr commented 9 years ago

Using a turing complete language as a configuration file is a bad idea, so I am not interested in adding support for that. If you are currently doing that, you are welcome to try and make a case for it.

the file argument has been officially deprecated in version 1.1.1