# simple-injector-ts

> This is a pure injector class.

Latest version **1.0.0** (published 2018-09-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install simple-injector-ts
pnpm add simple-injector-ts
yarn add simple-injector-ts
bun add simple-injector-ts
```

## 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.0 |
| Published | 2018-09-21 |
| First published | 2018-09-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 124.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Yard |
| Maintainers | yard |

## Links

- npm: https://www.npmjs.com/package/simple-injector-ts
- npm.io page: https://npm.io/package/simple-injector-ts

## Recent versions

- 1.0.0 (latest) — 2018-09-21

## README

## injector

This is a pure injector class.

## use
```
const { Injector } = require('injector')

const injector = new Injector({}) // init dep scope

injector.register('service', () => { // register dep into scope
  return 'service';
});

injector.register('router', () => {
  return 'router';
});

// use dep in code
const doSomething = injector.resolve(
  ['service', 'router'], // the dep used in this function 
  function (hhh) { // main function
    expect(this.service()).toBe('service');
    expect(this.router()).toBe('router');
    expect(hhh).toBe('aaa');
  }, 
  {}, // local scope register
  'aaa' // the other params
);

doSomething();
```

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