node-monkeywrench
Node.js helper library
Configuration
Introduction
Configuration can come from a variety of sources:
- text files
- INI file format
- Java .properties format
- JSON format
- YAML
- Apple PList
- command line options
- single character options (
-d
) - multiple character options (
--dir
)
- single character options (
- environment variables (
$HOME
) - Windows registry
monkeywrench
was designed to extract configuration from nodejs
applications.
Configuration
Configuration is configured with a JSON file of the following format:
{
"targets": {
"propertyname": {
"description": "This is a one-liner about what this property does",
"long_description": "This is a much longer description of the property.",
"default": false,
"required": false,
"type": "boolean",
"where": [
}
}
"sources": [
{"type": "file", "filename": "~/.myconfig"},
{"type": "env"}
],
}