1.1.3 • Published 17 days ago

@kitmi/config v1.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
17 days ago

@kitmi/config

JavaScript Env-aware Config

@kitmi/config provides a simple and flexible way to manage configuration settings for applications across different environments. It supports both JSON and YAML file formats and automatically selects the appropriate configuration based on the current environment.

Features

  • Environment-aware: Automatically loads configuration files based on the environment setting.
  • Supports JSON and YAML: Seamlessly works with both JSON and YAML configuration files.
  • Easy to use: Provides a straight forward API to access configuration values.
  • Customizable: Allows custom environment variable names and custom configuration file paths.
  • Fallbacks: Supports default configuration for unspecified environments.

Installation

To install @kitmi/config, run the following command:

bun install @kitmi/config

Or if you're using npm:

npm install @kitmi/config

Usage

  1. Create configuration files for your environments, e.g., config.development.json, config.production.json, config.default.yaml.

  2. Import the library and use it to access your configuration settings:

import ConfigLoader from '@kitmi/config';

const configLoader = ConfigLoader.createEnvAwareJsonLoader(<config path>, 'config', <development|production>);
await configLoader.load_();

License

  • MIT
  • Copyright (c) 2023 KITMI PTY LTD
1.1.1

17 days ago

1.1.0

17 days ago

1.1.3

17 days ago

1.1.2

17 days ago

1.0.0

5 months ago