@totalsoft/key-per-file-configuration
v1.1.0
Published
Key per file configuration provider
Downloads
960
Readme
key-per-file-configuration
A module that loads environment variables from files on the disk. Each file is loaded into a process environment variable using the following convention:
- file name -> environment variable name
- file contents -> environment variable contents
The files are loaded and monitored from the given configPath
(default 'runtime' folder). This path can be a folder that is scanned recursively, or it can be a glob pattern.
Installation
npm i @totalsoft/key-per-file-configuration
or
yarn add @totalsoft/key-per-file-configuration
Usage
const keyPerFileConfig = require('@totalsoft/key-per-file-configuration')
const configWatcher = keyPerFileConfig.load({configPath: 'runtime'})
...
await configWatcher.close()
load
options
Options {
// The path where the configuration files can be found (supports glob)
configPath?: string;
}