# scarlet-ioc

> A Javascript IoC container

Latest version **2.0.3** (published 2014-04-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install scarlet-ioc
pnpm add scarlet-ioc
yarn add scarlet-ioc
bun add scarlet-ioc
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.3 |
| Published | 2014-04-13 |
| First published | 2014-04-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.2.0 |
| Dependencies | 10 |
| Known vulnerabilities | 0 (+5 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | fir3pho3nixx |
| Maintainers | fir3pho3nixx |
| Keywords | ioc, scarlet, scarlet-plugin, dependency, injection, solid |

## Links

- npm: https://www.npmjs.com/package/scarlet-ioc
- Repository: https://github.com/fir3pho3nixx/scarlet-contrib-ioc
- Homepage: https://github.com/fir3pho3nixx/scarlet-contrib-ioc.git
- Issues: https://github.com/fir3pho3nixx/scarlet-contrib-ioc/issues
- npm.io page: https://npm.io/package/scarlet-ioc

## Dependencies (10)

- [lodash](https://npm.io/package/lodash.md) ^1.3.1
- [string](https://npm.io/package/string.md) ^1.4.0
- [scarlet](https://npm.io/package/scarlet.md) ^2.0.2
- [browserify](https://npm.io/package/browserify.md) ^3.41.0
- [grunt-spawn](https://npm.io/package/grunt-spawn.md) ^1.1.52
- [grunt-release](https://npm.io/package/grunt-release.md) ^0.3.5
- [string-format](https://npm.io/package/string-format.md) ^0.2.1
- [grunt-browserify](https://npm.io/package/grunt-browserify.md) ^2.0.7
- [grunt-contrib-watch](https://npm.io/package/grunt-contrib-watch.md) ^0.4.4
- [grunt-contrib-jshint](https://npm.io/package/grunt-contrib-jshint.md) ^0.4.3

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 2.0.3 (latest) — 2014-04-13

## README

scarlet-ioc
===========

A plugin for doing IoC using Scarlet.

##Installation

    npm install scarlet-ioc

##Quickstart

```javascript
function MyObjectA(){
	var self = this;
	self.anyMethod = function(){
		console.log("calling A");
	};
}

function MyObjectB(myObjectA){
	var self = this;
	self.anyMethod = function(){
		myObjectA.anyMethod();
		console.log("calling B");
	};
}

var Scarlet = require("scarlet");
var scarlet = new Scarlet(["scarlet-ioc"]);

scarlet.plugins.ioc
	.register("myObjectA", MyObjectA)
	.register("myObjectB", MyObjectB);

var myObjectB = scarlet.plugins.ioc.resolve("myObjectB");
myObjectB.anyMethod();
```

---
_Source: https://npm.io/package/scarlet-ioc · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
