# ts-injection

> Dependency injection framework for Typescript/Javascript NodeJS applications.

Latest version **3.2.0** (published 2022-09-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install ts-injection
pnpm add ts-injection
yarn add ts-injection
bun add ts-injection
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.2.0 |
| Published | 2022-09-22 |
| First published | 2021-03-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 52.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Tyler Burke |
| Maintainers | tylerburke |
| Keywords | typescript, di, dependency injection, injection, nodejs, decorators, annotations |

## Links

- npm: https://www.npmjs.com/package/ts-injection
- Repository: https://github.com/burketyler/ts-injection
- Homepage: https://github.com/burketyler/ts-injection#readme
- Issues: https://github.com/burketyler/ts-injection/issues
- npm.io page: https://npm.io/package/ts-injection

## Dependencies (1)

- [reflect-metadata](https://npm.io/package/reflect-metadata.md) 0.1.13

## 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

- 3.2.0 (latest) — 2022-09-22
- 3.1.3 — 2022-09-02
- 3.1.2 — 2022-09-02
- 3.1.1 — 2022-09-02
- 3.1.0 — 2022-09-01
- 3.0.2 — 2022-03-20
- 3.0.1 — 2022-03-20
- 3.0.0 — 2022-03-14
- 2.0.2 — 2022-01-06
- 2.0.1 — 2022-01-06
- 2.0.0 — 2022-01-06
- 1.2.2 — 2021-11-10
- 1.0.0 — 2021-11-10
- 1.2.0 — 2021-07-05
- 1.1.9 — 2021-06-24
- … 9 more at https://npm.io/package/ts-injection/versions

## README

<p align="center">
    <img width="200px" src="https://content.tylerburke.dev/images/ts-injection-logo.png" />
</p>

<a href="https://www.npmjs.com/package/ts-injection"><img src="https://img.shields.io/npm/v/ts-injection.svg"/></a>
<a href="https://bundlephobia.com/result?p=ts-injection"><img src="https://img.shields.io/bundlephobia/minzip/ts-injection.svg"/></a>
<img src="https://img.shields.io/badge/license-MIT-blue.svg"/>
<img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg"/>

ts-injection is an annotation based dependency injection framework written in Typescript for NodeJS apps. It enables building
applications that have loosely coupled components.

## Show me some code

```typescript
@Injectable()
class ArnyService {
  public getQuote(): string {
    return "Get to the choppa!";
  }
}

@Injectable()
class ArnyApp {
  @Autowire(ArnyService)
  private service!: ArnyService;

  public getQuote(): string {
    return this.service.getQuote();
  }
}

const container = new InjectionContainer();

function main(): void {
  const app = container.resolve(ArnyApp);
  
  console.log(handler.getQuote());
}
```

## Features

- 🌾 Field injection
- 🔨 Constructor injection
- 🔢 Environment variable parsing

<a href="https://burketyler.github.io/ts-injection/docs/usage"><p align="center" style="font-size: 25px">View full documentation</p></a>

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