1.1.0 • Published 2 years ago

@totalsoft/key-per-file-configuration v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years 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 (supports glob)
    configPath?: string;
}
1.1.0

2 years ago

2.4.2

2 years ago

1.0.0

2 years ago