# force-inject

> simple dependency injection

Latest version **0.0.1** (published 2017-09-22) · ISC license · 0 weekly downloads

## Install

```sh
npm install force-inject
pnpm add force-inject
yarn add force-inject
bun add force-inject
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2017-09-22 |
| First published | 2017-09-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | marzk |

## Links

- npm: https://www.npmjs.com/package/force-inject
- Repository: https://github.com/marzk/force-inject
- Homepage: https://github.com/marzk/force-inject#readme
- Issues: https://github.com/marzk/force-inject/issues
- npm.io page: https://npm.io/package/force-inject

## Recent versions

- 0.0.1 (latest) — 2017-09-22

## README

# force-inject

simple dependency inject support async, generator function.

*caveat*:
1. cant suport args with comments
2. support async only node > 7.6.0

## install

```js
npm install force-inject
```

## usage


```

import inject from 'force-inject';

const context = {
  state: {
    a: 1,
  },
};

function test(a, state) {
  console.log(a, state.a);
}

const injectTest = inject(test)(context);

console.log(injectTest(2));
// 2, 1

console.log(injectTest());
// undefined, 1


// inject function only support the parameters after invoking arguments
console.log(injectTest(2, 3));
// 2, 3

```

`test` will show more usages.

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