# concat-merge

> Recursively merge objects

Latest version **1.2.1** (published 2025-12-13) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 50/100 (C)** — status: stable.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2025-12-13 |
| First published | 2021-01-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | ambarli |
| Keywords | gogen, concat, merge |

## Links

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

## Recent versions

- 1.2.1 (latest) — 2025-12-13
- 1.2.0 — 2024-08-15
- 1.1.0 — 2024-03-16
- 1.0.3 — 2021-01-30
- 1.0.2 — 2021-01-30
- 1.0.1 — 2021-01-29
- 1.0.0 — 2021-01-29

## README

# concat-merge

[![test workflow](https://github.com/ambar/concat-merge/actions/workflows/test.yml/badge.svg)](https://github.com/ambar/concat-merge/actions/workflows/test.yml)

Recursively merge objects, especially for webpack/rollup configs.

## Comparison

| name                                                                                                                                                        | immutable | concat           | dedupe           | clone            | multiple parameters | recommended |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | ---------------- | ---------------- | ---------------- | ------------------- | ----------- |
| concat-merge <br> [![concat-merge](https://img.shields.io/bundlephobia/minzip/concat-merge)](https://bundlephobia.com/package/concat-merge)                 | `true`    | `true`           | `false`          | `true`           | yes                 | yes         |
| merge-deep <br> [![merge-deep](https://img.shields.io/bundlephobia/minzip/merge-deep)](https://bundlephobia.com/package/merge-deep)                         | `true`    | `true`           | `true`           | `true`           | yes                 | yes         |
| deepmerge <br> [![deepmerge](https://img.shields.io/bundlephobia/minzip/deepmerge)](https://bundlephobia.com/package/deepmerge)                             | `true`    | `true`           | `false`          | `false` (option) | no                  |             |
| lodash/merge <br> [![lodash.merge](https://img.shields.io/bundlephobia/minzip/lodash.merge)](https://bundlephobia.com/package/lodash.merge)                 | `false`   | `false`          | `false`          | `true`           | yes                 |             |
| lodash/mergeWith <br> [![lodash.mergewith](https://img.shields.io/bundlephobia/minzip/lodash.mergewith)](https://bundlephobia.com/package/lodash.mergewith) | `false`   | `false` (option) | `false` (option) | `true`           | yes                 | yes         |

## Install

```
npm install concat-merge
```

## Usage

```js
import concatMerge from 'concat-merge'

concatMerge(baseConfig, {
  input: 'entry.js',
  plugins: [inject({React: 'react'})],
})
```

lodash equivalent:

```js
import mergeWith from 'lodash/mergeWith'

const concatMerge = (...args) =>
  mergeWith({}, ...args, (prev, next) => {
    if (Array.isArray(prev)) {
      return prev.concat(next)
    }
  })
```

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