@totalsoft/key-per-file-configuration
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

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;
}

Readme

Keywords

Package Sidebar

Install

npm i @totalsoft/key-per-file-configuration

Weekly Downloads

245

Version

1.1.0

License

MIT

Unpacked Size

37.9 kB

Total Files

15

Last publish

Collaborators

  • osstotalsoft