local-configuration-manager
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

Local properties manager

Introduction

properties-manager is a tool to open properties files in local applications. This allows you to have several general configuration files and configurations for rest clients separated by runtime environment. The tool will take the corresponding file depending on the execution environment in which it is located.

Installation

To install the library, use the following command:

npm install properties-manager

Usage

getConfigFile

Note: Default without environment variable

./config/dev.default.json

{
    "test_key": "test_value"
}
 const config = getConfigFile();
 console.log(config.test_key)

Note: Custom without environment variable

./config/dev.custom.json

{
    "test_key": "test_value"
}
 const config = getConfigFile('custom');
 console.log(config.test_key)

Note: Default with environment variable

./config/prod.default.json

{
    "test_key": "test_value"
}

ENVIRONMENT=prod

 const config = getConfigFile();
 console.log(config.test_key)

Note: Custom with environment variable

./config/prod.custom.json

{
    "test_key": "test_value"
}

ENVIRONMENT=prod

 const config = getConfigFile('custom');
 console.log(config.test_key)

getRestClientFile

Note: Default without environment variable

./config/dev.rest_client.json

{
    "test_key": "test_value"
}
 const config = getRestClientFile();
 console.log(config.test_key)

Note: Default with environment variable

./config/prod.rest_client.json

{
    "test_key": "test_value"
}

ENVIRONMENT=prod

 const config = getRestClientFile();
 console.log(config.test_key)

Contributions

If you wish to contribute to the library, please feel free to create a fork and pull request

Readme

Keywords

Package Sidebar

Install

npm i local-configuration-manager

Weekly Downloads

1

Version

1.0.3

License

MIT

Unpacked Size

8.24 kB

Total Files

12

Last publish

Collaborators

  • ulysses_code