Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

env-config

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

env-config

env-config reads configuration for twelve-factor-apps from environment variables

  • 0.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

env-config

Build Status

env-config reads configuration for twelve-factor-apps from environment variables.

install

npm install env-config

use

given some environment variables:

MY_PROJECT_PORT=8080
MY_PROJECT_MYSQL_USER=foo
MY_PROJECT_MYSQL_PASSWORD=bar
MY_PROJECT_LOG_INFO=true
MY_PROJECT_PROVISION_RATE=0.2

use them in your application:

envConfig = require 'env-config'

specification =
    port: 'int'
    mysqlUser: 'string'
    mysqlPassword: 'string'
    logInfo: 'bool'
    provisionRate: 'float'

envConfig 'MY_PROJECT', specification, process.env

# =>  {
#       port: 8080,
#       mysqlUser: 'foo',
#       mysqlPassword: 'bar',
#       logInfo: true
#       provisionRate: 0.2
#   }

the first parameter (prefix to all environment variables) is optional.

envConfig throws an exception if an environment variable is empty or can't be converted to the specified type.

license: MIT

FAQs

Package last updated on 14 Jan 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc