node-convict
node-convict copied to clipboard
Support loading configs from package.json/.npmrc
I'd like to propose adding support for loading configs from npm compatible inputs, primarily the package.json file or .npmrc.
- The file override could be enhanced to read either a
.jsonor an.npmrc - The
ENVkey could be enhanced to supportnpm-configenv vars - A new key could be added, which loads from the
configblock of the localpackage.jsonfile
I think this could provide added benefit to the abilities of convict:
- easier to use with CI testing tools, such as travis, which automatically take direction from the
.npmrc - would enable the usage of two
convictapps on the same system, without worrying about clashingenvvars - would allow multiple config targets within a single application to do directory-recursive overrides (ex... a web app with 2 servers, a user front-end, and an admin dashboard, both can load the same config module, but receive the dynamic configuration described above)
@LongLiveCHIEF I find the idea interesting. What do other interested parties (@rfk, @vladikoff) think?