# forwardablejs

> ES6 lib for jspm

Latest version **0.1.68** (published 2015-02-11) · 0 weekly downloads

## Install

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

## 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.1.68 |
| Published | 2015-02-11 |
| First published | 2015-01-12 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | djindjic |

## Links

- npm: https://www.npmjs.com/package/forwardablejs
- Repository: http://github.com/djindjic/forwardablejs
- Homepage: https://github.com/djindjic/forwardablejs
- Issues: https://github.com/djindjic/forwardablejs/issues
- npm.io page: https://npm.io/package/forwardablejs

## Recent versions

- 0.1.68 (latest) — 2015-02-11
- 0.1.66 — 2015-02-11
- 0.1.61 — 2015-02-10
- 0.1.59 — 2015-02-06
- 0.1.58 — 2015-02-06
- 0.1.56 — 2015-02-04
- 0.1.53 — 2015-01-28
- 0.1.52 — 2015-01-28
- 0.1.51 — 2015-01-21
- 0.1.50 — 2015-01-19
- 0.1.47 — 2015-01-19
- 0.1.46 — 2015-01-19
- 0.1.45 — 2015-01-19
- 0.1.44 — 2015-01-16
- 0.1.41 — 2015-01-12
- … 9 more at https://npm.io/package/forwardablejs/versions

## README

ES6 lib for jspm

<p align="left">
<a href="https://travis-ci.org/djindjic/forwardablejs">
  <img alt="Travis Status" src="http://img.shields.io/travis/djindjic/forwardablejs/master.svg?style=flat&amp;label=travis">
</a>

<a href="https://codeclimate.com/github/djindjic/forwardablejs">
  <img alt="Code Climate Score" src="http://img.shields.io/codeclimate/github/djindjic/forwardablejs.svg?style=flat">
</a>
</p>
  
forwardablejs
===========
ES6 lib for jspm inspired by Ruby Forwardable.

###Instalation
```bach
jspm install npm:forwardablejs
```

###Basic usage

```js
import {Forwardable} from 'lib/index';

class Receiver {
  constructor() { this._name = ''; this._hello = ''; }
  get name() { return this._name; }
  set name(value) { this._name = value; }
  get hello() { return this._hello; }
  set hello(value) { this._hello = value; }
  greet(location) {
    return `${this._hello} ${this._name}, this is ${location}`;
  }
}
class Delegator {
  constructor(receiver) {
    this._receiver = receiver;
    Forwardable.delegate(this, this._receiver, 'hello', 'hello_alias');
    Forwardable.delegate(this, this._receiver, 'name', 'name_alias');
    Forwardable.delegate(this, this._receiver, 'greet', 'greet_alias');
  }
}

let receiver = new Receiver();
let delegator = new Delegator(receiver);
delegator.hello_alias = 'hello';
delegator.name_alias = 'forwardablejs';

expect(delegator.greet_alias('github')).to.equal('hello forwardablejs, this is github');
```

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