# dependency-injection-v1

> dependency-injection-v1 is a JS/TS library for dealing with Dependency Injection.

Latest version **1.0.6** (published 2021-04-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install dependency-injection-v1
pnpm add dependency-injection-v1
yarn add dependency-injection-v1
bun add dependency-injection-v1
```

## 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.6 |
| Published | 2021-04-14 |
| First published | 2021-04-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Hamza Farhan |
| Maintainers | lekato |
| Keywords | dependency-injection, di |

## Links

- npm: https://www.npmjs.com/package/dependency-injection-v1
- npm.io page: https://npm.io/package/dependency-injection-v1

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 1.0.6 (latest) — 2021-04-14
- 1.0.5 — 2021-04-14
- 1.0.4 — 2021-04-13
- 1.0.3 — 2021-04-13
- 1.0.2 — 2021-04-13
- 1.0.1 — 2021-04-13
- 1.0.0 — 2021-04-13

## README

# dependency-injection-v1

dependency-injection-v1 is a JS/TS library for dealing with Dependency Injection.

## Installation

Use the package manager [npm](https://www.npmjs.com/) to install dependency-injection-v1.

```bash
npm install dependency-injection-v1
```

## Usage

```ts
import { Injectable, Inject } from 'dependency-injection-v1';

@Injectable
class A {
  public getUser() {
    return {
      username: 'lekato',
      message: 'easy but good',
    };
  }
}

class B {
  @Inject(A) propertyA: A;

  public showUserMessage() {
    const user = this.propertyA.getUser();
    console.log(`${user.username} said: ${user.message}`);
  }
}

const b = new B();
b.showUserMessage();
```

## Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

## License

[MIT](https://choosealicense.com/licenses/mit/)

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