# inversify-extension

> ## About InversifyJS Extension is project

Latest version **1.0.1** (published 2021-04-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install inversify-extension
pnpm add inversify-extension
yarn add inversify-extension
bun add inversify-extension
```

## 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 | 1.0.1 |
| Published | 2021-04-02 |
| First published | 2021-04-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 9.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | alexgladin |

## Links

- npm: https://www.npmjs.com/package/inversify-extension
- npm.io page: https://npm.io/package/inversify-extension

## Dependencies (2)

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

## Recent versions

- 1.0.1 (latest) — 2021-04-02
- 1.0.0 — 2021-04-02

## README

# InversifyJS Extension

## About
InversifyJS Extension is project 

## Installation

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

```
$ npm install inversify inversify-extension reflect-metadata
```

## Examples
### AutoNamed factory
The old way for writing named factory:
```ts
container.bind<interfaces.Factory<Katana>>("Factory<Katana>")
  .toFactory<Katana>((context: interfaces.Context) => (named: string): Katana => {
    return context.container.getNamed<Katana>("Katana", named);
  });
```

Now you can write in a more simple way:
```ts
import { ContainerExtension } from 'inversify-extension';

const container = new ContainerExtension();

container.bind<interfaces.Factory<Katana>>("Factory<Katana>")
  .toAutoNamedFactory<Katana>("Katana");
```

The same way for a factory that works with tags:
```ts
import { ContainerExtension } from 'inversify-extension';

const container = new ContainerExtension();

container.bind<interfaces.Factory<Katana>>("Factory<Katana>")
  .toAutoTaggedFactory<Katana>("Katana");
```

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