@travi/ioc

extremely simple container that loosely aligns to IOC

Usage no npm install needed!

<script type="module">
  import traviIoc from 'https://cdn.skypack.dev/@travi/ioc';
</script>

README

ioc

extremely simple container that loosely aligns to IOC

npm license Build Status

Commitizen friendly semantic-release Greenkeeper badge

Installation

$ npm install @travi/ioc -S

Usage

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