# najs-binding

> > A simple and powerful dependency injection, service container, instance resolver for Node applications

Latest version **1.8.0** (published 2018-04-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install najs-binding
pnpm add najs-binding
yarn add najs-binding
bun add najs-binding
```

## 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.8.0 |
| Published | 2018-04-14 |
| First published | 2018-02-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=6.9 |
| Dependencies | 1 |
| Unpacked size | 73.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Nhat Phan |
| Maintainers | najs |

## Links

- npm: https://www.npmjs.com/package/najs-binding
- Repository: https://github.com/najs-framework/najs-binding
- Homepage: https://github.com/najs-framework/najs-binding#readme
- Issues: https://github.com/najs-framework/najs-binding/issues
- npm.io page: https://npm.io/package/najs-binding

## Dependencies (1)

- [lodash](https://npm.io/package/lodash.md) ^4.17.4

## Recent versions

- 1.8.0 (latest) — 2018-04-14
- 1.7.0 — 2018-04-10
- 1.6.0 — 2018-04-09
- 1.5.0 — 2018-04-06
- 1.4.1 — 2018-04-06
- 1.4.0 — 2018-03-17
- 1.3.1 — 2018-03-13
- 1.3.0 — 2018-02-26
- 1.2.0 — 2018-02-22
- 1.1.0 — 2018-02-22
- 1.0.0 — 2018-02-21

## README

## Najs Binding

> A simple and powerful dependency injection, service container, instance resolver for Node applications

[![Travis](https://img.shields.io/travis/najs-framework/najs-binding/master.svg?style=flat-square)](https://travis-ci.org/najs-framework/najs-binding/builds)
[![Maintainability](https://api.codeclimate.com/v1/badges/64b3477c2a139bfcace4/maintainability)](https://codeclimate.com/github/najs-framework/najs-binding/maintainability)
[![Coverage Status](https://img.shields.io/coveralls/najs-framework/najs-binding/master.svg?style=flat-square)](https://coveralls.io/r/najs-framework/najs-binding?branch=master)
[![node version](https://img.shields.io/node/v/najs-binding.svg?style=flat-square)](https://nodejs.org/en/download/)
[![npm version](https://img.shields.io/npm/v/najs-binding.svg?style=flat-square)](http://badge.fury.io/js/najs-binding)
[![npm downloads](https://img.shields.io/npm/dm/najs-binding.svg?style=flat-square)](http://badge.fury.io/js/najs-binding)
[![npm license](https://img.shields.io/npm/l/najs-binding.svg?style=flat-square)](http://badge.fury.io/js/najs-binding)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)

### What is Service Container?

The Service container is a powerful tool for managing class dependencies and performing dependency injection.

For example, suppose you have a simple `UserService` class that contains all `users` from database:

```javascript
// written in Javascript
class UserService {
  @autoload('UserRepository') userRepository

  getUsers() {
    return this.userRepository.getUsers()
  }
}
```

In this example, the UserService needs to retrieve users from a data source. So, we will inject a repository
that is able to retrieve users. Since the repository is injected, we are able to easily swap it out with another
implementation. We are also able to easily "mock", or create a dummy implementation of the UserRepository when
testing our application.

### Usage

### API

#### register()

#### make()

#### bind()

#### @autoload()

#### ClassRegistry

### License

MIT @ Nhat Phan

```

```

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