# @booster-ts/core

> Core Booster DI Library

Latest version **0.2.1** (published 2019-05-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install @booster-ts/core
pnpm add @booster-ts/core
yarn add @booster-ts/core
bun add @booster-ts/core
```

## Health

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

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

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2019-05-01 |
| First published | 2019-04-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 21.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | ImOverlord |
| Maintainers | imoverlord |
| Keywords | DI, Core, Booster, Dependecy, Injection |

## Links

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

## Dependencies (3)

- [typescript](https://npm.io/package/typescript.md) ^3.4.3
- [@types/node](https://npm.io/package/@types/node.md) ^11.13.8
- [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

- 0.2.1 (latest) — 2019-05-01
- 0.2.2 (beta) — 2020-01-29
- 0.2.0 — 2019-04-30
- 0.1.1 — 2019-04-23
- 0.1.0 — 2019-04-23
- 0.0.1 — 2019-04-18

## README

# Booster-ts Core

Core DI Library

## Installation

You can get the latest release and the type definitions using npm:

```
$ npm install @booster-ts/core reflect-metadata --save
```

> /!\\ @booster-ts/core requires TypeScript >= 2.0, your tsconfig should look similar to the one below (experimentalDecorators, emitDecoratorMetadata are important)
```js
{
    "compilerOptions": {
        "target": "es5",
        "lib": ["es6"],
        "types": ["reflect-metadata"],
        "module": "commonjs",
        "moduleResolution": "node",
        "experimentalDecorators": true,
        "emitDecoratorMetadata": true
    }
}
```

## Getting Started

You can declare dependencies with @booster() decorator.

```ts
import { booster } from '@booster-ts/core';

@booster()
export class DependencyA {
    public data: number = 0;
}
```

You can then require this dependency.

```ts
import { booster } from '@booster-ts/core';
import { DependencyA } from "./dependencyA";

@booster()
export class DependencyD {

    constructor(public a: DependencyA   ) { }

    public update() {
        this.a.data++;
    }
}
```

@booster-ts/core will resolve the dependencies needed for you

```ts
import { Injector } from '@booster-ts/core';

const injector = new Injector();
const dep: DependencyD = injector.inject(DependencyD);

dep.update();
```

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