Skip to content
/ ioc Public

extremely simple container that loosely aligns to IOC

License

Notifications You must be signed in to change notification settings

travi/ioc

Repository files navigation

ioc

extremely simple container that loosely aligns to IOC

Node CI Workflow Status SLSA Level 2

Commitizen friendly Renovate semantic-release: angular

Usage

license npm

Installation

$ npm install @travi/ioc -S

Making an instance available through the container

import {register} from '@travi/ioc';

const instance = factory();

add('instance-name', instance);

Getting an instance from the container

import {use} from '@travi/ioc';

const instance = use('instance-name');