@biorate/config-loader-env
v1.93.1
Published
Config loader for ENV's config
Downloads
729
Readme
ENV config loader
ENV-based config loader
Features
- ENV config loader middleware
Examples
import { inject, container, Types, Core } from '@biorate/inversion';
import { IConfig, Config } from '@biorate/config';
import { IConfigLoader } from '@biorate/config-loader';
import { ConfigLoaderEnv } from '@biorate/config-loader-env';
class Root extends Core() {
@inject(Types.Config) public config: IConfig;
@inject(Types.ConfigLoaderEnv) public configLoaderEnv: ConfigLoaderEnv;
}
container.bind<IConfig>(Types.Config).to(Config).inSingletonScope();
container.bind<ConfigLoader>(Types.ConfigLoaderEnv).to(ConfigLoaderEnv).inSingletonScope();
container.bind<Root>(Root).toSelf().inSingletonScope();
(async () => {
const root = container.get<Root>(Root);
await root.$run();
root.config.get('test'); // Hello world!
})();
See
@biorate/config-loader docs for details
Learn
- Documentation can be found here - docs.
Release History
See the CHANGELOG
License
Copyright (c) 2021-present Leonid Levkin (llevkin)