# mixto

> A mixin superclass. Its subclasses have `.extend` and `.includeInto` methods to mix behavior into other objects and classes.

Latest version **1.0.0** (published 2014-01-16) · 0 weekly downloads

## Install

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

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2014-01-16 |
| First published | 2013-10-09 |
| Weekly downloads | 0 |
| TypeScript types | separate (@types/mixto) |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 14 |
| Author | Nathan Sobo |
| Maintainers | nathansobo, kevinsawicki |
| Keywords | mixin, trait |

## Links

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

## Recent versions

- 1.0.0 (latest) — 2014-01-16
- 0.4.0 — 2014-01-03
- 0.3.0 — 2013-11-12
- 0.2.0 — 2013-11-08
- 0.1.0 — 2013-10-09

## README

# Mixto: A simple mixin superclass [![Build Status](https://travis-ci.org/atom/mixto.png?branch=master)](https://travis-ci.org/atom/mixto)

To create a mixin, subclass mixto:

```coffee
Mixin = require 'mixto'

class MyMixin extends Mixin
  @classMethod: -> console.log("foo")
  instanceMethod: -> console.log("bar")
```

Then mix into classes with `.includeInto`:

```coffee
class MyClass
  MyMixin.includeInto(this)
  
MyClass.classMethod()
(new MyClass).instanceMethod()
```

Or extend individual objects with `.extend`:

```coffee-script
myObject = {a: 1, b: 2}
MyMixin.extend(myObject)
myObject.instanceMethod()
```

Or build standalone instances of your 'mixin':

```
standalone = new MyMixin
standalone.instanceMethod()
```

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