env-config
v0.3.0
Published
env-config reads configuration for twelve-factor-apps from environment variables
Downloads
30
Readme
Env Config
read configuration from environment variables.
Install
npm install https://github.com/snd/env-config.git
Use
envConfig = require 'env-config'
specification =
port: 'int'
mysqlUser: 'string'
mysqlPassword: 'string'
logInfo: 'bool'
environment =
PROJECT_NAME_PORT: '8080'
PROJECT_NAME_MYSQL_USER: 'foo'
PROJECT_NAME_MYSQL_PASSWORD: 'bar'
PROJECT_NAME_LOG_INFO: 'true'
config = envConfig 'PROJECT_NAME_', specification, environment
console.log config
# => {
# port: 8080,
# mysqlUser: 'foo',
# mysqlPassword: 'bar',
# logInfo: true
# }
License
MIT