2.0.6 • Published 4 years ago

rk-config v2.0.6

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

rk-config

Build Status Coverage Status

An environment-aware config system.

Features

  • Multiple data source.
  • Deep override.
  • Rewrite config.
  • Support interpolation: ES6 string template, Javascript value

Examples

 let fileSource = new JsonConfigProvider('path/to/config.json');
 let config = new ConfigLoader(fileSource);
 await config.load_()...;

 let dbSource = new DbConfigProvider(config.data.dbConnection);
 config.provider = dbSource;
 await config.reload_()...;

 // same as: let envAwareLoader = new ConfigLoader(
 //    new (EnvAwareConfigProviderF('.json', JsonConfigProvider, 'default'))('config/dir', 'app', 'production')
 // );
 let envAwareLoader = ConfigLoader.createEnvAwareJsonLoader('config/dir', 'app', 'production');
 
 // Loader will load config/dir/app.default.json first, 
 // and then load config/dir/app.production.json, 
 // and finally override the default.
 let cfg = await envAwareLoader.load_(); 

License

MIT

2.0.6

4 years ago

2.0.5

5 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

7 years ago

1.0.0

7 years ago