appfig
Combines nconf, recurpolate, and declarative JSON "extends"
syntax to create an extremely useful configuration loader.
Usage
All the value packed into appfig
is demonstrated in ./example
, which is summarized for your reading below. appfig
is compatible with Node 8+. Enjoy.
config/default.json
config/development.json
config/production.json
index.js
processenvAPP_ENV = processenvAPP_ENV || 'development'; const APP_ENV = processenv; const config = __dirname + `/config/.json`; console;console;console;
Starting your application with development configuration
$ node index.js 3000tracehttp://dev.example.com/users
Starting your application with production configuration
$ APP_ENV=production node index.js 3001infohttp://www.example.com/users
Use it
appfig
is released under the MIT License.