2.0.0 • Published 8 months ago

@totalsoft/key-per-file-configuration v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

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
    configPath?: string;
}
2.0.0

8 months ago

1.1.0

3 years ago

2.4.2

3 years ago

1.0.0

3 years ago