configurenv
v1.0.0
Published
A configuration manager to help with 12 Factor Apps
Downloads
3
Readme
ConfigurENV
Configuration Manager that uses Environment Variables to create your configuration.
Example
const config=require('configurenv')(
[
{
type: "enum",
values: ["MYSQL","POSTGRESQL","MSSQL"],
env: "DRIVER",
mapping: "driver",
default: "MYSQL"
},
{
type:"config",
env: "CONNECTION",
mapping: "connection",
config: [
{
type: "string",
env: "HOST",
mapping: "host",
default: "127.0.0.1"
},
{
type: "int",
env: "PORT",
mapping: "port",
default: 3300
}
]
}
],{
namespace: "DEMOAPP"
})
}).build(process.env)
console.log(config.config) //List our config values
console.log(config.struct) //List the parsed config