0.1.5 • Published 5 years ago
@uplatform/config v0.1.5
uPlatform - Config Component
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
- Describe a functionality of "optional" stores.
- 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