You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
visionmedia edited this page Oct 10, 2012
·
7 revisions
The Extended-JSON library allows you to transform JSON using plugins, and comes with several plugins that are very useful for app configuration. To get started add eson:
$ npm install eson --save
Then require eson and select a configuration file based on the NODE_ENV environment variable, defaulting to "development":
The file variable will then contain a path to ./config/development.json, ./config/production.json etcetera. Two plugins are used here, .env() to read config from environment variables, and .args() to read from ARGV.
Now if you had { "log path": "/tmp/app.log" } in development.json, you could override this with a MYAPP_LOG_PATH=/some/path environment variable, or with node app --log-path /some/path.