connie-lang
Configuration language for connie.
Installation
$ npm install --save connie-lang
Usage
var ConnieLang = ; var config = ConnieLang;
Language Reference
${ENV_VAR} Environment Variable Replacement
@{ref} Self-Reference Replacement
Default Values
You can provide a default value in either of the patterns above, using :
as
a separator.
For instance, ${PORT:3000}
means to substitute the PORT
environment variable, but if that does not exist, it will return the string
'3000'
instead. This also works with reference patterns, like
@{common.domain:foo.com}
, which will use 'foo.com'
as the default value
if common.domain
does not exist in the current config.
Examples
original config object
When this configuration is executed with an empty environment, the result is:
parsed config object
However, if the PORT environment variable is set to 4000, then this would change to:
parsed config object