# extendify

> Deep extend with customizable behavior for Node.js

Latest version **1.0.0** (published 2015-12-13) · MIT license · 0 weekly downloads

## Install

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

## 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 | 2015-12-13 |
| First published | 2014-07-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+4 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 20 |
| Author | bighshai |
| Maintainers | bigshai |
| Keywords | extend, deep, merge, lodash, underscore, nested |

## Links

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

## Dependencies (1)

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

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2015-12-13
- 0.1.0 — 2014-07-05

## README

![Logo](/resources/img/logo.png)

#### Deep extend with customizable behavior for Node.js.

"Extedify" is a lightweight wrapper over [lodash](http://lodash.com)'s `_.merge` (like a *deep* `_.extend`) with customizable handling of arrays, booleans, numbers and strings.

(By default, *extedify* will behave exactly like lodash's `_.merge`.)

## Installation

```javascript
npm install extendify
```

## Usage
```javascript
var extendify = require('extendify');
myExtend = extendify({
    // options
});
```


## Options

- `inPlace` – Override the 'source' with the result?
    - true (*default*)
    - false
- `isDeep` – Use deep extend?
    - true (*default*)
    - false
- `arrays` – How to handle arrays?
    - replace (*recommended*)
    - concat
    - merge (*default*)
    - or
    - and
- `booleans` – How to handle booleans?
    - replace (*default*)
    - concat
    - or
    - and
- `numbers` – How to handle numbers?
    - replace (*default*)
    - concat
    - or
    - and
- `strings` – How to handle strings?
    - replace (*default*)
    - concat
    - or
    - and

## Example
Let's get an _.extend function that
- **returns a copy/clone**,
- **replaces arrays**,
- supports **nested objects** (also known as **deep extends**).

```javascript
_.extend = extendify({
    inPlace: false,
    isDeep: true,
    arrays : 'replace'
});

object1 = {
    a:{
        list: [1, 2]
    },
    b: 4
};

object2 = {
    a:{
        list: [3]
    }
};

var result = myExtend(object1, object2);
/*
{
    a: {
        list: [3]
    },
    b: 4
}
*/
```

More examples are available in the 'examples.js' file.


## Contributions

Your feedback is welcome, email me at [_reshef.shai@gmail.com_](mailto:reshef.shai@gmail.com).

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