Stok Config
Stok Config provides a method for loading configuration values form environment variables for twelve-factor apps.
Example
const http = const loadConfiguration = const config = const server = http server
API
loadConfiguration(config) Returns: Object
Loads configuration from environment variables and the .env
file and stores it in a structured object.
config
(Object): A mapping between a structured config object and the associated env vars.
In the following example, web.port
will have the value of the PORT
env var. Similarly, db.host
, db.user
, and db.password
will have the values of the DB_HOST
, DB_USER
, and DB_PASSWORD
env vars, respectively. db.port
will have the value of the DB_PORT
env var, but if the env var doesn't exist, the default value of 3306
will be used.
const config =
License
Copyright Stok Config contributors. Released under the terms of the ISC license.