Configa
Application configuration: DRY, flexible and type-safe. Pick any three.
:warning: Configa is in early development. It's been factored out of Sparkla, another project in early development, for more general usage.
Install
npm install --save @stencila/configa
Usage
All configuration options can be set, in descending order of priority, by:
- a command line argument e.g.
--<value> <value>
- an environment variable prefixed with
CONFIGA_
e.g. CONFIGA_<option>=<value>
- a
.json
or .ini
configuration file, set using the --config
option, or .configarc
by default
Name | Description | Type | Default |
---|
appName | The name of the application.1 | string | undefined |
configPath | Path to the configuration file to be parsed. | string | "config.ts" |
readmePath | Path to the README file to be updated. | string | "README.md" |
- Determines the expected prefix on the names of
config files and environment variables.
If
undefined
then parse the name from the
package name in ./package.json
.