Simple schema-based configuration for twelve-factor apps
Note: this package is currently in beta.
- 12-factor ready: encourages portable configuration via environment vars
- Schema based: define options via json compatible schema
- Independent: look ma, no dependencies
- Immutable: creates a read-only config object for your sanity
npm install zenconfig
const zenconfig = require('zenconfig')
// Define configuration schema
const schema = {
"NODE_ENV": {
"type": "string",
"default": "development"
},
"PORT": {
"type": "number",
"default": 8080
},
"HOST": {
"type": "string"
}
}
// Create immutable configuration from environment
const config = zenconfig(schema, process.env)
This software is released under the MIT license, see LICENSE.