# yaab

> Yet another auto-binder

Latest version **1.0.3** (published 2019-06-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install yaab
pnpm add yaab
yarn add yaab
bun add yaab
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2019-06-27 |
| First published | 2018-03-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 12.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Dan Hughes |
| Maintainers | dan1elhughes |

## Links

- npm: https://www.npmjs.com/package/yaab
- Repository: https://github.com/dan1elhughes/yaab
- Homepage: https://github.com/dan1elhughes/yaab#readme
- Issues: https://github.com/dan1elhughes/yaab/issues
- npm.io page: https://npm.io/package/yaab

## Recent versions

- 1.0.3 (latest) — 2019-06-27
- 1.0.2 — 2019-01-31
- 1.0.1 — 2018-08-02
- 1.0.0 — 2018-07-03
- 0.2.0 — 2018-04-04
- 0.1.0 — 2018-03-26
- 0.0.1 — 2018-03-08

## README

# Yaab (Yet another auto binder)

[![CircleCI](https://circleci.com/gh/dan1elhughes/yaab/tree/master.svg?style=shield)](https://circleci.com/gh/dan1elhughes/yaab/tree/master)
[![codecov](https://codecov.io/gh/dan1elhughes/yaab/branch/master/graph/badge.svg)](https://codecov.io/gh/dan1elhughes/yaab)
[![npm version](https://badge.fury.io/js/yaab.svg)](https://badge.fury.io/js/yaab)

Forces class methods to be bound to instances. There are plenty of libraries to do this already, but this one is my one. Also I wrote tests.

Preconfigured for React, i.e. ignores `render()` and `component...()` methods.

## Installation

Via npm:

```bash
$ npm install --save yaab
```

## Usage

```js
import bindMethods from 'yaab';

class TestClass {
	constructor() {
		this.property = 'value';
		bindMethods(this);
	}

	method() {
		return this.property;
	}
}

const instance = new TestClass();
const { method } = instance;

console.log(method()); // => 'value'
```

## API

### bindMethods(obj, [ignoredMethods])

Binds all methods on the object to itself.

#### obj

Object with methods to be bound. Typically a "this" at the end of a constructor.

#### ignoredMethods

Array of method names to ignore.

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