# mix2

> The YUI mix

Latest version **1.0.5** (published 2019-05-11) · MIT license · 0 weekly downloads

## Install

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

## 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 | 1.0.5 |
| Published | 2019-05-11 |
| First published | 2014-07-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 0 |
| Unpacked size | 3.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | kaelzhang |
| Maintainers | kael |
| Keywords | mix, extend, yui, yui-mix, merge, object |

## Links

- npm: https://www.npmjs.com/package/mix2
- Repository: https://github.com/kaelzhang/node-mix2
- Homepage: https://github.com/kaelzhang/node-mix2#readme
- Issues: https://github.com/kaelzhang/node-mix2/issues
- npm.io page: https://npm.io/package/mix2

## Recent versions

- 1.0.5 (latest) — 2019-05-11
- 1.0.4 — 2019-04-30
- 1.0.3 — 2019-04-18
- 1.0.2 — 2017-09-13
- 1.0.1 — 2014-08-12
- 1.0.0 — 2014-08-12
- 0.1.6 — 2014-07-21
- 0.1.5 — 2014-07-21
- 0.1.4 — 2014-07-21
- 0.1.3 — 2014-07-21
- 0.1.2 — 2014-07-21
- 0.1.1 — 2014-07-21
- 0.1.0 — 2014-07-21

## README

[![Build Status](https://travis-ci.org/kaelzhang/node-mix2.svg?branch=master)](https://travis-ci.org/kaelzhang/node-mix2)

# mix2

The port of YUI3's mix method for node. Mixins two objects.

## Install

```bash
$ npm install mix2
```

## Usage

```js
const a = {a: 1}
const b = {b: 2}
const c = {a: 10, b: 20, c: 30}

mix(a, b)
console.log(a) // {a: 1, b: 2}

// Will not override the existing property 'a'
mix({a: 1}, c, false)             // {a: 1,  b: 20, c: 30}

// Only copy property 'a' and 'c', and override.
mix({a: 1}, c, true, ['a', 'c'])  // {a: 10, c: 30}
```

### mix(receiver, supplier, [override], [copylist])

- receiver `Object`
- supplier `Object`
- override `Boolean=true` Whether should override the existing property of `receiver`. Default to overriding(`true`)
- copylist `(Array.<String>)=` If specified, only mix the specific keys in the array. Otherwise, mixin all properties.

Extend the object `receiver` with `supplier`, and returns `receiver`.

## License

MIT
<!-- do not want to make nodeinit to complicated, you can edit this whenever you want. -->

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