# mixiner

> A library, that implement mixins in TypeScript or JavaScript classes

Latest version **2.0.0** (published 2018-01-03) · MIT license · 0 weekly downloads

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

## Install

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

## Health

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

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2018-01-03 |
| First published | 2017-10-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Shvab Ostap |
| Maintainers | shvabuk |
| Keywords | mixin, mixiner, javascript, typescript |

## Links

- npm: https://www.npmjs.com/package/mixiner
- Repository: https://github.com/shvabuk/mixiner
- Homepage: https://shvabuk.github.io/mixiner/
- Issues: https://github.com/shvabuk/mixiner/issues
- npm.io page: https://npm.io/package/mixiner

## Dependencies (3)

- [phantomjs](https://npm.io/package/phantomjs.md) ^2.1.7
- [typescript](https://npm.io/package/typescript.md) ^2.6.2
- [@types/node](https://npm.io/package/@types/node.md) ^8.5.2

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2018-01-03
- 1.0.5 — 2017-10-30
- 1.0.4 — 2017-10-29
- 1.0.3 — 2017-10-28
- 1.0.2 — 2017-10-28
- 1.0.1 — 2017-10-28
- 1.0.0 — 2017-10-28

## README

# <span class="logo">[MIXINER](https://shvabuk.github.io/mixiner) </span>

Mixiner is [fast](https://github.com/shvabuk/mixiner/blob/gh-pages/_docs/performance.md) and small javascript library, that implement mixins in TypeScript or JavaScript classes.

[![Join the chat at https://gitter.im/soft-support/mixiner](https://img.shields.io/gitter/room/soft-support/mixiner.svg?style=flat-square)](https://gitter.im/soft-support/mixiner)
[![npm version](https://img.shields.io/npm/v/mixiner.svg?style=flat-square)](https://www.npmjs.com/package/mixiner)
[![codecov](https://codecov.io/gh/shvabuk/mixiner/branch/master/graph/badge.svg)](https://codecov.io/gh/shvabuk/mixiner)
[![Build Status](https://travis-ci.org/shvabuk/mixiner.svg?branch=master)](https://travis-ci.org/shvabuk/mixiner)

## Basic TypeScript usage
``` javascript
// create mixin
class SpeackableMixin {
    protected phrase: string;
    public speak(): string {
        return this.phrase;
    }
}
// implement SpeackableMixin
@mixiner(SpeackableMixin)
class Duck {
    protected phrase = 'quack';
    public speak: () => string;
}
// create instance
const donald = new Duck();
// test instance
donald.speak(); // 'quack'
```

## Basic JS usage
``` javascript
// create mixin
class SpeackableMixin {
    speak() {
        return this.phrase;
    }
}
// implement SpeackableMixin
const Duck = mixiner(SpeackableMixin)(class Duck {
    constructor() {
        super();
        this.phrase = 'quack';
    }
});

// create instance
const donald = new Duck();
// test instance
donald.speak(); // 'quack'
```

## Download
* <i class="fa fa-download" aria-hidden="true"></i> [Main build](https://raw.githubusercontent.com/shvabuk/mixiner/master/dist/mixiner.js) ([~1kB gzipped](https://raw.githubusercontent.com/shvabuk/mixiner/master/dist/mixiner.min.js))
* <i class="fa fa-cloud-download" aria-hidden="true"></i> [CDN jsdelivr](https://cdn.jsdelivr.net/npm/mixiner)
* <i class="fa fa-cloud-download" aria-hidden="true"></i> [CDN unpkg](https://unpkg.com/mixiner/dist/mixiner.js)

## Installation

Using npm:
``` shell
$ npm install --save mixiner
```

TypeScript:
``` javascript
import mixiner from 'mixiner';
```

Node.js / CommonJS:
``` javascript
const mixiner = require('mixiner');
```

## Support
* <i class="fa fa-chrome" aria-hidden="true"></i> Chrome
* <i class="fa fa-firefox" aria-hidden="true"></i> Firefox
* <i class="fa fa-safari" aria-hidden="true"></i> Safari
* <i class="fa fa-edge" aria-hidden="true"></i> Edge
* <i class="fa fa-internet-explorer" aria-hidden="true"></i> IE 9-11

Tested in:
* <i class="fa fa-server" aria-hidden="true"></i> Node.js 8

## License

Mixiner is released under the [MIT license](https://raw.githubusercontent.com/shvabuk/mixiner/master/LICENSE.txt)

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