@chubbyts/chubbyts-dic-config
v1.2.0
Published
Dependency injection container creation by config, inspired by laminas-config.
Downloads
525
Maintainers
Readme
chubbyts-dic-config
Description
Dependency injection container creation by config, inspired by mezzio-config.
Requirements
- node: 16
- @chubbyts/chubbyts-dic: ^1.2.0
- @chubbyts/chubbyts-dic-types: ^1.2.1
Installation
Through NPM as @chubbyts/chubbyts-dic-config.
npm i @chubbyts/chubbyts-dic-config@^1.2.0
Usage
import {
createContainerByConfigFactory,
ConfigFactory,
ConfigDelegator,
} from '@chubbyts/chubbyts-dic-config/dist/dic-config';
const containerByConfigFactory = createContainerByConfigFactory({
dependencies: {
services: new Map<string, any>(),
factories: new Map<string, ConfigFactory>(),
aliases: new Map<string, string>(),
delegators: new Map<string, Array<ConfigDelegator>>(),
},
// ... other configuration
});
const container = containerByConfigFactory();
Copyright
2023 Dominik Zogg