@uplatform/config

0.1.5 • Public • Published

uPlatform - Config Component

npm version license

Usage

Step 1. Install the module

npm install --save @uplatform/config

Step 2. Configure the config sources

const configRetriever = new ConfigRetriever({
    stores: [
        {
            type: 'http',
            url: 'http//some-host/some-path/config.json',
        },
        {
            type: 'env',
            keys: {
                DATABASE_URL: 'database.url',
            },
        },
    ],
});

const config = await configRetriever.getConfig();

console.log(config.database.url);

Supported config sources

  • Environment variables
  • Files
  • HTTP endpoints

Supported config formats

  • JSON
  • YAML (requires npm install --save js-yaml)

TODO

  1. Describe a functionality of "optional" stores.
  2. Describe existing stores API

Roadmap

  • Implement an API for loading own config parses
  • Implement an API for loading own config stores
  • Add support of configuration state services (e.g. etcd, zookeeper, consul)

Authors

  • Karabutin Alex

Readme

Keywords

Package Sidebar

Install

npm i @uplatform/config

Weekly Downloads

0

Version

0.1.5

License

MIT

Unpacked Size

19.8 kB

Total Files

17

Last publish

Collaborators

  • karabutin-alex