app-conf
Usage
var loadConfig = require("app-conf").load;
loadConfig("my-application", {
appDir: __dirname,
}).then(function(config) {
console.log(config);
});
The following files are looked up and merged (the latest take
precedence):
config.*
in the project directory;/etc/my-application/config.*
;~/.config/my-application/config.*
;/.my-application.*
down to ./.my-application.*
in the current
working directory.
Relative paths, string values starting by ./
or ../
, are automatically
resolved from the config file directory.
JSON format is supported natively but you may install the following
packages to have additional features:
Contributing
Contributions are very welcome, either on the documentation or on
the code.
You may:
- report any issue
you've encountered;
- fork and create a pull request.
License
ISC © Julien Fontanet