env-config
env-config reads configuration for twelve-factor-apps from environment variables
Last updated 7 years ago .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install env-config 
SYNC missed versions from official npm registry.

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

Current Tags

  • 0.3.0                                ...           latest (7 years ago)

4 Versions

  • 0.3.0                                ...           7 years ago
  • 0.2.1                                ...           7 years ago
  • 0.2.0                                ...           8 years ago
  • 0.1.0                                ...           8 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 3
Dependencies (3)
Dev Dependencies (1)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |