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
.json
or an.npmrc
- The
ENV
key could be enhanced to supportnpm-config
env vars - A new key could be added, which loads from the
config
block of the localpackage.json
file
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
convict
apps on the same system, without worrying about clashingenv
vars - 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?