ioc

December 17, 2023 ยท View on GitHub

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');

Contents

  1. 1Usage
  2. 1.1Installation
  3. 1.2Making an instance available through the container
  4. 1.3Getting an instance from the container