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.
npm i @totalsoft/key-per-file-configuration
or
yarn add @totalsoft/key-per-file-configuration
const keyPerFileConfig = require('@totalsoft/key-per-file-configuration')
const configWatcher = keyPerFileConfig.load({configPath: 'runtime'})
...
await configWatcher.close()
Options {
// The path where the configuration files can be found
configPath?: string;
}