# union-merge

> union merge

Latest version **1.0.3** (published 2018-01-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install union-merge
pnpm add union-merge
yarn add union-merge
bun add union-merge
```

## 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.3 |
| Published | 2018-01-04 |
| First published | 2018-01-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Cooper Hsiung |
| Maintainers | cooperhsiung |

## Links

- npm: https://www.npmjs.com/package/union-merge
- npm.io page: https://npm.io/package/union-merge

## Dependencies (1)

- [lodash](https://npm.io/package/lodash.md) ^4.17.4

## Recent versions

- 1.0.3 (latest) — 2018-01-04
- 1.0.2 — 2018-01-03
- 1.0.1 — 2018-01-03
- 1.0.0 — 2018-01-03

## README

union-merge
=========

[![NPM Version][npm-image]][npm-url]

Deeply merging unstructured data.

## Installation

```bash
npm i union-merge -S
```

## usage

```js

const unionMerge = require('union-merge');

let target = {
    name: 'Tom',
    age: '30',
    orders: [
        {orderId: 20180104, price: 200, title: 'a', phone: 1234},
        {orderId: 20180105, price: 200, title: 'a'}
    ]
};

let source = {
    name: 'Tom',
    age: 31,
    orders: [
        {orderId: 20180104, price: 200, title: 'a'},
        {orderId: 20180105, price: 220, title: 'a', phone: 1234, email: '1@1.com'},
        {orderId: 20180106, price: 200, title: 'a'},
        {orderId: 20180107, price: 200, title: 'a', phone: 1234},
    ]
};

let result = unionMerge(target, source, ['orderId']);

/*

{
    name: 'Tom',
    age: 31,
    orders: [
        {orderId: 20180104, price: 200, title: 'a', phone: 1234},
        {orderId: 20180105, price: 220, title: 'a', phone: 1234, email: '1@1.com'},
        {orderId: 20180106, price: 200, title: 'a'},
        {orderId: 20180107, price: 200, title: 'a', phone: 1234},
    ]
}
  
*/

```

## Tests

```bash
no scripts
```

## Contributing

...

[npm-image]: https://img.shields.io/npm/v/union-merge.svg
[npm-url]: https://www.npmjs.com/package/union-merge

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