# herit

> [![Build Status](https://secure.travis-ci.org/caseywebdev/herit.png)](http://travis-ci.org/caseywebdev/herit)

Latest version **2.2.2** (published 2014-03-17) · 0 weekly downloads

## Install

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

## 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 | 2.2.2 |
| Published | 2014-03-17 |
| First published | 2013-09-26 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Casey Foster |
| Maintainers | caseywebdev |

## Links

- npm: https://www.npmjs.com/package/herit
- Repository: https://github.com/caseywebdev/herit
- Issues: https://github.com/caseywebdev/herit/issues
- npm.io page: https://npm.io/package/herit

## Recent versions

- 2.2.2 (latest) — 2014-03-17
- 2.2.1 — 2014-01-03
- 2.2.0 — 2014-01-03
- 2.1.1 — 2014-01-03
- 2.1.0 — 2014-01-03
- 2.0.0 — 2013-09-26

## README

# herit

[![Build Status](https://secure.travis-ci.org/caseywebdev/herit.png)](http://travis-ci.org/caseywebdev/herit)

Easy to use JavaScript "Class" inheritance with support for "instance" and
"static" properties.

## Install

In the browser, simply include the script on the page.

In Node, all you need to do is `var herit = require('herit')`.

## Usage

```js
var Animal = herit({
  name: 'Chupacabra',
  sound: 'roarmeowbarkmoo',
  sing: function () {
    alert(this.name + ' says ' + Array(5).join(this.sound));
  }
});

var HardWorker = herit();

var Dog = herit(Animal, HardWorker, {
  name: 'Gunner',
  sound: 'woof'
}, {staticProp: 'hello'});

var Cat = herit(Animal, {
  name: 'Mittens',
  sound: 'meow'
});

(new Animal()).sing();
(new Cat()).sing();
(new Dog()).sing();

// (new Cat) instanceof Animal === true
// (new Cat) instanceof Cat === true

// Dog.staticProp === true
// (new Dog) instanceof Animal === true
// (new Dog) instanceof HardWorker === true
// (new Dog) instanceof Dog === true
```

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