# mixin-attr

> mixin object

Latest version **1.0.0** (published 2017-01-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install mixin-attr
pnpm add mixin-attr
yarn add mixin-attr
bun add mixin-attr
```

## 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.0 |
| Published | 2017-01-20 |
| First published | 2017-01-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | laomu1988@qq.com |
| Maintainers | laomu |

## Links

- npm: https://www.npmjs.com/package/mixin-attr
- Repository: https://github.com/laomu1988/mixin-attr
- Homepage: https://github.com/laomu1988/mixin-attr#readme
- Issues: https://github.com/laomu1988/mixin-attr/issues
- npm.io page: https://npm.io/package/mixin-attr

## Recent versions

- 1.0.0 (latest) — 2017-01-20

## README

# 混合对象属性
 混合两个对象的属性,假如属性名不重复则不会被覆盖
 例如对象{a:{b:1}}和{a:{c:1}}混合后将变成{a:{b:1,c:1}}

## install
```
npm install mixin-attr --save
```

## usage
```
var mixin = require('mixin-attr');

var target1 = mixin(
    {a: {b: 1}},
    {a: {c: 1}}
);

console.log(JSON.stringify(target1));
// 将输出: {"a":{"b":1,"c":1}}


var target2 = mixin(
    {a: {b: 1}},
    {"a.c":1}  // 当属性中带有.时,将会自动展开
);
console.log(JSON.stringify(target2));
// 将输出: {"a":{"b":1,"c":1}}

```


## test
```
npm run test
```

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