# extendable

> Extend constructors using backbone's .extend signature

Latest version **0.1.0** (published 2014-10-27) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

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

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2014-10-27 |
| First published | 2012-09-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Arnout Kazemier |
| Maintainers | V1 |
| Keywords | backbone, underscore, lodash, extend, inherit, inherits |

## Links

- npm: https://www.npmjs.com/package/extendable
- Repository: https://github.com/3rd-Eden/extendable
- Issues: https://github.com/3rd-Eden/extendable/issues
- npm.io page: https://npm.io/package/extendable

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2014-10-27
- 0.0.6 — 2013-08-15
- 0.0.5 — 2013-08-09
- 0.0.4 — 2013-08-08
- 0.0.3 — 2012-09-20
- 0.0.2 — 2012-09-14
- 0.0.1 — 2012-09-14
- 0.0.0 — 2012-09-14

## README

# Extend your JavaScript constructors in the same as you are used to in backbone.js

[![Build Status](https://travis-ci.org/3rd-Eden/extendable.png)](https://travis-ci.org/3rd-Eden/extendable)

```js
var extend = require('extendable')
  , EventEmitter = require('events').EventEmitter;

function Awesomeness() {
  var self = this;

  setTimeout(function () {
    self.render(self.data);
  }, 100);

  EventEmitter.call(this);
}

Awesomeness.prototype = new EventEmitter;
Awesomeness.prototype.constructor = Awesomeness;

Awesomeness.prototype.data = 'bar';
Awesomeness.prototype.render = function render() {
  // does nothing
};

Awesomeness.extend = extend;
```

And you can now use it

```js
var SuperAwesome = Awesomeness.extend({
    data: 'trololol'

  , render: function render(data) {
      console.log(data);
    }
});

new SuperAwesome();
// outputs "trololo" after 100 ms
```

### License

MIT

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