# injector-mvc

> NodeJS MVC Injector

Latest version **1.0.2** (published 2016-05-12) · ISC license · 0 weekly downloads

## Install

```sh
npm install injector-mvc
pnpm add injector-mvc
yarn add injector-mvc
bun add injector-mvc
```

## 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 | 1.0.2 |
| Published | 2016-05-12 |
| First published | 2016-05-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | André Bonna |
| Maintainers | andre.bonna |

## Links

- npm: https://www.npmjs.com/package/injector-mvc
- Repository: https://github.com/andrebonna/injector-mvc
- Issues: https://github.com/andrebonna/injector-mvc/issues
- npm.io page: https://npm.io/package/injector-mvc

## Recent versions

- 1.0.2 (latest) — 2016-05-12
- 1.0.1 — 2016-05-12
- 1.0.0 — 2016-05-12

## README

# injector-mvc
NodeJS MVC Injector


<h1>Methods:</h1>

**init(options, controllersPaths, otherPaths)**
  * options - javascript object with already required elements
  * controllersPaths - array of absolute paths that contains Controllers classes
  * otherPaths - array of absolute paths that contains other Components classes
  
**Returns**: Injector object

<br>

**getInjector()**

**Returns**: Injector object

<br>


<h1>Injector Object Method:</h1>


**inject(className)** - Injects and return object
  * className - javascript file name without '.js'
  
 
  
Usage hints:
```javascript
var Injector = require('injector-mvc');
var injector = Injector.init({
	'app': app //Express app example
}, [__dirname+'/Controllers/'], [__dirname+'/Services/', __dirname+'/Models/']); //Already injects Controllers
```



```javascript
module.exports = (function(injector) {
  
  var fs = injector.inject('fs');
  var UserController = injector.inject('UserController');
  var UserService = injector.inject('UserService');
  var UserModel = injector.inject('UserModel');

})(require('injector-mvc').getInjector());
```

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